How do I Compare Speed (Physics Object)

Get help using Construct 2

Post » Mon Apr 25, 2016 7:33 pm

So I'm trying to find a way of seeing how fast one of my physics objects, the player, is going. However it doesn't seem to be a 'speed' inbuilt to the physics object...

Thanks in before hand! :D
B
9
S
1
Posts: 26
Reputation: 731

Post » Mon Apr 25, 2016 8:35 pm

Read the fabulous manual! https://www.scirra.com/manual/98/physics

VelocityX
VelocityY
The current speed of the physics object, in pixels per second.
Mistakes were made.
B
51
S
25
G
107
Posts: 1,581
Reputation: 60,458

Post » Mon Apr 25, 2016 8:43 pm

Also from those expressions you can get the total speed with:
distance(0, 0, sprite.physics.velocityx, sprite.physics.velocityy)

You'll need to use system->compare or system->"pick by comparison" to compare it.
B
92
S
32
G
106
Posts: 5,273
Reputation: 69,457

Post » Wed Apr 27, 2016 3:50 pm

Thank you very much!
B
9
S
1
Posts: 26
Reputation: 731


Return to How do I....?

Who is online

Users browsing this forum: lukewasthefish and 14 guests