How to measure velocity?

0 favourites
  • 7 posts
  • How to measure velocity of an object and than put the velocity value into a text object? Just like it's done car games.

  • Are you using a behaviour for the movement?

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • In physics, velocity, which is the rate of change of position (or speed in a particular direction), is a vector. Imagine that you just hit a ground ball on the baseball diamond and you’re running along the first-base line, or the s vector, 90 feet at a 45-degree angle to the positive x-axis. But as you run, it occurs to you to ask, “Will my velocity enable me to evade the first baseman?” A good question, because the ball is on its way from the shortstop.

    Whipping out your calculator, you figure that you need 3.0 seconds to reach first base from home plate; so what’s your velocity? To find your velocity, you quickly divide the s vector by the time it takes to reach first base

    This expression represents a displacement vector divided by a time, and time is just a scalar. The result must be a vector, too. And it is: velocity, or v:

    Your velocity is 30 feet/second at 45 degrees, and it’s a vector, v.

    Dividing a vector by a scalar gives you a vector with potentially different units and the same direction.

    In this case, you see that dividing a displacement vector, s, by a time gives you a velocity vector, v. It has the same magnitude as when you divided a distance by a time, but now you see a direction associated with it as well, because the displacement, s, is a vector.

    Or you can just use 8 direction Behavior and get the speed , I think platform behavior and car have it too. Physics objects let you check the velocity, and bullet lets you check speed in Pixels per second too.

  • I studied physics for 4 years mate, I know how to calculate velocity

    I already have 8 direction behavior so I can't use any others.

  • Like it says in the Manual on 8 direction

    the expression self.8direction.speed will give you the current objects speed in pixels per second..

  • Thanks I did it. I'll read the manual good through these days. I did read some of it before, but only when I needed something specific.

  • I studied physics for 4 years mate, I know how to calculate velocity

    I already have 8 direction behavior so I can't use any others.

    The second answer i gave lets you know that the Physics behavior has the Velocity. You can get the speed from the 8 direction movement, but not the Velocity, it is speed in pixes per second IIRC.

    So to use the 8 Direction , and get the velocity, you are going to have to put your extensive physics training to work . First you will need to determine your scale though.

    Have a nice day

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)