0 Favourites

Physics and Portals

  • Hey guys

    So I have started using the physics in Construct and everything has been super easy to use. I'm having a slight issue when sending a rolling object through a portal type system like the one that is set up in the CAPX included

    When sent through the orange portal on the bottom it exits on the ledge and loses quite a bit of momentum. The weird thing is if the ball is sent through the blue portal on the ledge it exits through the orange portal with increased momentum but in the opposite direction

    Game File


    Thank you for taking a look and any help is greatly appreciated.

  • Construct 3

    Buy Construct 3

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

    Buy Now Construct 3 users don't see these ads
  • you make a physical object cross hundreds of pixels in one tick. I still wonder why it's not even worth than just that.

    I would probably save velocity and torque in variable on collision and reapply them after transfert (with maybe some some orientation changes if your portals have differents angles)

  • Thanks for the help. I ended up not saving it as a global variable only because I couldn't figure out a way to get the properties of the ball to save to a global variable.

    Instead I added an instance variable to the ball called Pushed to prevent the bullet from hitting the ball more than once and moving to fast.

    Once the ball comes in contact with one square it is destroyed and the opposite square will respawn a new ball and reapply the torque/velocity. This is the reason that I added instance variable, and limit the speed, because the spawning torque/velocity are set by hand and I wanted the speed of the ball going in the portal to match the speed coming out, or at least look close.

    Thanks again for the help and here is the updated CAPX incase anyone is interested!

    Updated Game File


Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)
Similar Topics Posts Views Last Post
Unread hot topic
1,941 263,235
FlyingRam's avatar
Unread hot topic
0 Favourites
[BEHAVIOR] Chipmunk Physics
673 82,485
nelostic's avatar
Unread hot topic
0 Favourites
[BEHAVIOR] Sonic Physics
126 31,159
Ostrich10164's avatar