How do i control the physics? - HELP

  • Hey guys!

    I have a sprite(ball) with physics, i give to it a "Force", X=40 and Y=-140.

    Nothing strange, just an example.

    So, when i run the project the sprite(ball) moving at X,Y position. All good!

    Now, I use a button to "pause" and "resume" the sprite(ball).

    So, when i pause i use "Physics: Disabled"..

    ..and the problem is when i resume it, i enable the physics but the moving of the sprite(ball) stops from X direction and just follow down.

    What's wrong?

  • "I have a sprite(ball) with physics, i give to it a "Force", X=40 and Y=-140. "

    When do you apply force for it ?

    Check the World Gravity of physic, if you let the physic idle, it always has the gravity as default and pull the ball down.

  • Thanks for your reply.

    Please check here:

    dropbox.com/s/4yfdvfs23nv2nv3/Physics.capx

    To understand more:

    The object moving in x,y (no matters, just example).

    Now, when you run the project, press "pause" and then "play" again, you will see the object "lose" the path (i have a line graphic just to see how is moving) and falling down.

    Note: I don't want the object to follow a "fake" line / path. The moving of the object it's just an example. Think to have more objects and moving in random directions and you want to pause and resume them again.

    So, this i need is "simple", i need to continue moving on path.

    Thanks!

  • So, this i need is "simple", i need to continue moving on path.

    My guess, the physic-behavior sets all to the default settings after disable it. So the force in x and y is 0 after enable it again.

    I would save the sprite 'AsJSON' in a variable when clicking the button and after clicking the button again load the JSON to the sprite.

    Example:

    drive.google.com/uc

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Great, thanks! :)

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