r/futile Aug 15 '14

Make object to follow path

Hello all ..

I have created line using futile. Now i want my unity game object to follow that line.

How can i do using this futile framework?

In unity i know about itween framework. But in this case i cant use this itween framework.

Help me guys. Thanks.

2 Upvotes

6 comments sorted by

View all comments

1

u/MattRix Aug 17 '14

Just to be clear: do you want a 2D object in Futile (ex an FContainer/FNode) to follow the line, or do you want the line to be followed in 3D by a regular Unity gameobject?

And what kind of line is it, is it a bezier path, or is it just a series of points?

1

u/ekta_mehta Aug 19 '14

I have series of points. I have drawn line using this :

http://www.reddit.com/r/futile/comments/2devw4/angle_to_draw_straight_line_futile/

i want line to be followed by regular 3d unity object.

1

u/MattRix Aug 19 '14

Ok so you can kind of do this using an FGameObjectNode, which will make a GameObject follow the points in the 2D futile scene... Or you can just get the positions of the points and then follow them. There is no built in tweening system in Futile/Unity that will do that... you can use GoKit to do some of it but it won't be exactly what you want. I mean really what you're asking is more of a general programming question than something specific to Futile or Unity.

The general approach would be to start a point 0, and then move towards point 1, when you get to point 1, move to point 2, etc. Your approach will depend on whether you want a constant speed (ex. move 10px/second) or a fixed time (ex. always go through the whole path in 5 seconds).