toggle menu
Categories
Discussions
Dashboard
Sign In
·
Register
Sign In
·
Register
Categories
Discussions
Dashboard
Sign In
·
Register
×
Home
›
GameSalad 101
›
Working with GS (Mac)
Check If Velocity is less than
themagicbox
Member, PRO
Posts:
82
May 2013
in
Working with GS (Mac)
How do i check if an actors velocity is less than a certain amount, do a rule...
Comments
Braydon_SFX
Member, Sous Chef, Bowlboy Sidekick
Posts:
9,273
May 2013
You could do something like this:
Rule:
When attribute self.Motion.Linear Velocity X (or Y) .....
You can also put in a condition for the Angular Velocity.
My GameSalad Academy Courses!
◦
Check out my quality templates!
◦ Add me on Skype: braydon_sfx
ORBZ
Member
Posts:
1,304
May 2013
Define attribute speed (real)
Constrain speed = magnitude(linearVelX, linearVelY)
Rule: speed < minimum
- do stuff
You can do this without a constraint like this:
Define game.ZERO = 0
Rule game.ZERO < minimumSpeed - magnitude(linearVelX, linearVelY)
- do stuff
Sign In
or
Register
to comment.
Comments
Rule:
When attribute self.Motion.Linear Velocity X (or Y) .....
You can also put in a condition for the Angular Velocity.
My GameSalad Academy Courses! ◦ Check out my quality templates! ◦ Add me on Skype: braydon_sfx
Constrain speed = magnitude(linearVelX, linearVelY)
Rule: speed < minimum
- do stuff
You can do this without a constraint like this:
Define game.ZERO = 0
Rule game.ZERO < minimumSpeed - magnitude(linearVelX, linearVelY)
- do stuff