Random only up and down direction actor
aitor010
Member Posts: 282
Hi!
How is possible make an actor that can use random up and down direction every 0,5 seconds???
I make an Time every 0,5 seconds but in directions what have I put (is a behavior "Move")?
Thanks in advance!
How is possible make an actor that can use random up and down direction every 0,5 seconds???
I make an Time every 0,5 seconds but in directions what have I put (is a behavior "Move")?
Thanks in advance!
Comments
Random (0,1) * 180
. . . . . . . . . .
Direction: (up and down)
(Random (0,1) * 180) + 90
. . . . . . . . . .
Thanks by reply @KevinCross and @Socks , I have this:
http://s2.subirimagenes.com/imagen/previo/thump_869535420131113-18.png
And not run... What I do bad?
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
The expression is: (Random (0,1) * 180) + 90
I change the expression of sped to direction (was a wrong)
It also helps if you understand what it's doing before you put in someone's suggestion as you'll never learn, and will never be able to modify it without breaking it.
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
I was very tempted to ! In fact if I wanted an actor to move randomly up and down I'd use sin/cos simply because you can get a nice dampening effect when you change direction, rather than a sudden sharp direction change.
I don't think you need the initial change attribute (direction to 270°) it works fine without that ?
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
Ah! I understand now !
(I quickly copied your set up, but I just entered 90° as the initial attribute value)