Move backwards on a path.
PepperBoi

Im creating a menu and im using the path system and it works really well but I have to have 2 paths for every menu element to go forwards and back and its gotten really busy. Is there a way to make the path backwards or is doing 2 paths per element a better idea?

1 Comment
Gio

Hi PepperBoi

Unfortunately I don't think you can simply set a negative speed on the Path to follow it backwards. However, no need to manually create two paths. Just create one, then you can clone it and reverse it in your code:

var nodes = path.getNodes(); // this gives you a copy of the array of nodes in the path
nodes.reverse();
var reversedPath = new Path(nodes);

 

Post a reply
Add Attachment
Submit Reply
Login to Reply