zig zag motion
bhaktaraj
Member, PRO Posts: 29
Hi all,
I have a missile I and want that to travel in zig zag motion. please help
I have a missile I and want that to travel in zig zag motion. please help
Comments
put in a timer
every 4 sec
change self.rotation to 45
create new rule
If self.rotation is = 45
Put in a timer
after 2 sec
Change attribute self.rotation to -45
But there are many ways to do it.
Change self.rotation to 45 (unless it already starts at 45.
Timer: Every 2 seconds change self.rotation to -self.rotation
Constrain Attribute: self.rotation To: (angleToTarget)+(30*cos(self.Time *500))
(I guess I'm nothing but a cheap and tawdry imitation. Still -- it's nice to stand offstage and see how the rock stars of GameSalad work their magic.)
hi @RThurman, i was wondering what you meant by "angleToTarget", did u mean "vector to angle"? My missile is moving from right to left of the screen. am using the move rule and the above constrain attribute that u suggested, but still going nowhere with it. Can u show me where am going wrong with it. Thank You
@djdee -- wow! blast from the past!
Yes, 'angleToTarget' would be an attribute that contains the angle from the hero to the target. It could be calculated by using 'vectorToAngle' or perhaps some other way.
@djdee -- here is a quick example
thanks a lot @RThurman
@djdee -- you are welcome!
And ensure your direction of movement is set to actor not scene! maybe!