Physics and Portals

0 favourites
  • 3 posts
From the Asset Store
About 900+ game portals: 400 e-mails, 514 contact/submit forms (last update: 2022, October, +275 contacts)
  • 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

    dl.dropbox.com/u/64691866/PortalsandPhysics.capx

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

  • Try Construct 3

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

    Try 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

    dl.dropbox.com/u/64691866/PortalsandPhysics2.capx

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