Move behavior with an angle attribute
![cibram](http://forums.gamesalad.com/applications/dashboard/design/images/defaulticon.png)
Hey guys,
I have an angle attribute, which has a formula and calculating an angle changing every second.
In the Actor's Move behavior i want him to move towards that angle, but because the attribute always changing my actor is changing the direction as well.
How can i fix that? Basically i want my actor move to the direction he takes from the attribute at the beginning, even the attribute will change my actor should not change the direction.
An example for what i want to do :
- My actor spawns
- Formula says him to move to the direction angle : 290
- He move to angle 290 and goes out of the screen
(He should not change this direction 290 to 250 or something else even the attribute change at the middle of the screen)
I have an angle attribute, which has a formula and calculating an angle changing every second.
In the Actor's Move behavior i want him to move towards that angle, but because the attribute always changing my actor is changing the direction as well.
How can i fix that? Basically i want my actor move to the direction he takes from the attribute at the beginning, even the attribute will change my actor should not change the direction.
An example for what i want to do :
- My actor spawns
- Formula says him to move to the direction angle : 290
- He move to angle 290 and goes out of the screen
(He should not change this direction 290 to 250 or something else even the attribute change at the middle of the screen)
Best Answer
-
jn2002dk Posts: 102
Make a local attribute in the actor you want to control, you could call it localAngle, and when the actor spawns set this.localAngle = the angle from your formula
Then you use localAngle to control the direction of your actor
Not at my GS computer right now so can't make an example
Answers
Let me know if you run into problems with it