How do I get physics speed.

  • Ive been trying to make radial gravity. I cant make normal gravitational pull that would work realistic. I use Force to make gravity on planet. What I'm trying to do is this:

    Object enters slowly into planets atmosphere and gets pulled towards planet, the faster it moves the bigger the force is. I tried using formula like this for Force: 100/distance(object.x ,object.y, planet.x , planet,y), but what i want is something like this: 100/distance(object.x ,object.y, planet.x , planet,y)*fallspeed. How can i get physics object speed?

  • In the manual it says VelocityX and VelocityY, but maybe I read it wrong..

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • It works only if you have one direction of gravity. And velocity is not speed :/

  • Velocity is not speed?

    Hmm, the Manual says it is:

    VelocityX

    VelocityY

    The current speed of the physics object, in pixels per second.

    So VelocityX is the speed in pixels per second in the horizontal direction

    VelocityY is the speed in pixels per second in the vertical direction

    Simply a matter of combining the two vectors to get your direction

  • Thanks, I just thought if you combine X Y, If you fall from different angle than 90 results would be different

  • As a note you get the speed from velocityX and velocityY with this calculation:

    speed = distance(0,0,velocityX,velocityY)

    or

    speed = sqrt(velocityX^2 + velocityY^2)

    which is the same, just whatever you prefer.

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