How to code Path movement


#1

Turn object and path object on to be able to code using Coblocks; This is done with a single click to the object under the Name Tag. The Path object is found under the Special library category. The object will travel the direction of the arrows of the path in the space. Adjust the blue dots to arrange a specified path.

Here is sample code:


#2

Can the dots on a path be individually named and accessed in code? They must have properties such as position(X, Y, Z)
For instance a game where a player piece is supposed to move around a game board. If player rolls a N on a die, move to the position of the Nth dot from the dot the player game piece is currently on.
Paths could then be used to illustrate equations and data in 3 dimensions. Students could create an equation for a roller coaster or a mountain range of rain fall history. A 3D periodic table?


#3

Hello, MrWolken

Points can be accessed from script code as usual items

Changing a path trajectory during animation of another object’s movement is possible but it will cause disortion of moving because length of path will be not recalculated. Could you please described you game in more details?

We are working of chart object for this purpose. Sure you can try use paths to illustrate equation, but main idea is to use it for moving other objects.


#4

Hi Stephanie,
thank you for sample.
I only want add something about editing path. There are two ways to add new vertices to existing path.

  1. Copying vertices by dragging them with ALT button pressed. New vertex will be automatically added to the nearest segment.

  2. Entering mode “Path editing”. Here you can choose manually a position on path to add new vertex.


#5

This is exciting! Thanks!


#6

Video tutorial is now available:


#7

A quick recommendation to set that path object to Opacity = 0 so your characters move around with more of a free illusion.


#8

Hello Clint,
for hiding path in play mode there is a setting “Show in Play mode”. Switch it off to hide a path during playing.


#9

Brilliant! I’m not sure how I missed that before. Thank you!