How do I get velocity per second w/Physics?

Get help using Construct 2

Post » Mon Jul 10, 2017 5:42 pm

Greetings! I am currently using :

int((P_hull.Physics.VelocityX^2 + P_hull.Physics.VelocityY^2)^0.5)

to get velocity of my car every tick. What I really need is a way to get car's velocity per second, in Pixel per second, lets say. How do I pull this off?

Thanks in advance. :!:
B
6
S
2
Posts: 99
Reputation: 1,336

Post » Mon Jul 10, 2017 11:07 pm

VelocityX and VelocityY are allready in units pixels/second.
IF you use the action 'Set stepping mode' to 'Framerate independent'

And if not, and that is the default setting, it using a fixed fake dt to calculate its speeds.
I think that is 1/60.
So then the correction is (Velocity /60) / dt

Normally the relation between 'pixels/tick' and 'pixels/second' is ...
'pixels/tick' = 'pixels/second' * dt
B
33
S
18
G
28
Posts: 2,493
Reputation: 20,950


Return to How do I....?

Who is online

Users browsing this forum: biasaur, Unconnected and 9 guests