How do I cancel a Move To behaviour?
ShaunElery
Member, PRO Posts: 148
Say that point A and point B are on different sides of the screen. I used the Move To behaiviour to make my actor go towards point A, but say that half way there I change my mind and want him to turn around and go to B instead. How do I cancel the Move To pointA behaviour? Right now the actor will not change direction mid way but I need him to.
Thank you
Thank you
Comments
and have an integer attribute, and if this attribute is 0 then set the actor to interpolate its self.position.x or y to point A and if the attribute is 1 set it to interpolate to point B.
(click anywhere on the screen to change direction)
http://www.mediafire.com/?al4pudjxajk6ja4
Rule
When game.turnaround is true,
Change attribute B.position.x to A. position.x
Change attribute B.position.y to A. position.y
Since the graphics and functioning are separate actors, it won't look like the button moved.
Hope this helps
Chakku
4 Real Attributes:
Current Target Position X
Current Target Position Y
Next Target Position X
Next Target Position Y
1st Rule (Any)
If Current Target Position X not= Next Target Position X
If Current Target Position Y not= Next Target Position Y
Change Current Target Position X to Next Target Position X
Change Current Target Position Y to Next Target Position Y
2nd Rule (All)
If Current Target Position X = Next Target Position X
If Current Target Position Y = Next Target Position Y
Move to Current Target Positions
Edit Next Target Positions when you want to change direction