How do I detect velocity?

Get help using Construct 2

Post » Thu Oct 01, 2015 3:40 am

How do I detect mass and velocity of object in a numerical value?
B
10
S
4
G
3
Posts: 223
Reputation: 3,458

Post » Thu Oct 01, 2015 4:38 am

If you're using the physics behavior there is an expression for mass and X an y velocity which you can combine to get the speed with distance(0,0, vx, vy).

If using another behavior then most have an expression for velocity or speed as well. Or if you'd like to calculate the speed with events you can if you keep track of the old position of the object.

Every tick
Set text to distance(Sprite.x,Sprite.y,oldx,oldy)/dt
Set oldx to Sprite.x
Set oldy to Sprite.y

Outside of the physics or chipmunk behavior's an object has no mass so there's nothing to calculate.
B
94
S
33
G
113
Posts: 5,353
Reputation: 73,267


Return to How do I....?

Who is online

Users browsing this forum: sean080, Yahoo [Bot] and 8 guests