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
92
S
32
G
107
Posts: 5,274
Reputation: 69,959


Return to How do I....?

Who is online

Users browsing this forum: Fenix18, tarek2 and 52 guests