Speed of object

Get help using Construct 2

Post » Mon Nov 28, 2011 5:32 am

Hi, i would like to try and determine when an object (in this case a ball) has come to a halt.

The ball has physics behaviors attached to it and when it stops i need to be able to determine if it has stopped in the right place.

Any ideas would be extremely helpful, thank you
B
12
S
1
G
2
Posts: 18
Reputation: 1,726

Post » Mon Nov 28, 2011 5:47 am

In a game I'm working on, I needed to do the same thing. This is the formula I used to determine the speed of a physics object:
sqrt(Object.Physics.VelocityX ^ 2 + Object.Physics.VelocityY ^ 2)

Where Object is the name of the object. I put this in a System: compare two values event.
B
25
S
8
G
8
Posts: 71
Reputation: 5,307

Post » Tue Nov 29, 2011 12:23 am

wow that's awesome, thanks for the help!
B
12
S
1
G
2
Posts: 18
Reputation: 1,726

Post » Tue Nov 29, 2011 2:13 am

You're welcome.
B
25
S
8
G
8
Posts: 71
Reputation: 5,307


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 20 guests