Need Help With Physics

0 favourites
  • 7 posts
From the Asset Store
Game with complete Source-Code (Construct 3 / .c3p) + HTML5 Exported.
  • Hello, I'm wondering if I can get some help with some odd behavior I'm seeing. The first is this:

    Subscribe to Construct videos now

    This shows a difference between NodeWebkit and Firefox browser, you see how the wall jump on NW.js is so much much bigger than it is on Firefox? Any hints as to what's causing that? I noticed on Chrome too the wall jump was also massive.

    My second problem is here:

    Subscribe to Construct videos now

    I'm building my level out of lots of 24x24 immovable physics objects, as the whole game is physics. My character is just a circle collider and if I jump while standing next to a wall made of these geometry tiles, the wall pushes the character back quite a lot versus if jumping next to just one tiles stretched two tiles high.

    Again, any hints as to what I can investigate to fix these issues would be great.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • For the first issue, did you set the physics mode to framerate-independent? Because by default it is framerate-dependent and can cause such issues.

    And the second one, did you check the collision polygons of the tiles? The character just bumps into them it seems. It´s probably better (and more performant) if you use an extra invisible collision object to avoid that since you can just strech them at will.

  • For the first issue, did you set the physics mode to framerate-independent? Because by default it is framerate-dependent and can cause such issues.

    And the second one, did you check the collision polygons of the tiles? The character just bumps into them it seems. It´s probably better (and more performant) if you use an extra invisible collision object to avoid that since you can just strech them at will.

    Thanks for the reply. I did set physics to frame rate-independence and while it did 'break' some of the actions I still observed the same inconsistent difference between the Chrome and Firefox versions. Here's my code, I'm not sure if there's anything glaringly wrong here:

    For the second issue, yeah I'm aware the way I'm doing this is not the most performant, it's just much quicker to make levels this way, I can randomize the frame and angle of the tiles at the start of the layout for variation and the geometry and graphics are just there as I build it, but yes perhaps I can't get past this issue without a better process.

  • I'd say this looks fine. You could try disabling the timescale, maybe that messes with something. You could also check if it actually is triggered only once, there are some cases where you can still manage trigger it every tick. And you could try adding dt to the force you apply to the player (self.force+4)*dt though I feel like that shouldn't be the issue if it's actually only triggered once, but who knows.

  • Try setting a velocity X rather than applying a force X to make the sideways jump. Forces have different results depending on the frame time (the engine assumes that the force is applied for the duration of the frame).

  • oh lol that is actually the wrong code. However your answers are very helpful.

    Here's the correct code I'm using:

  • Try setting a velocity X rather than applying a force X to make the sideways jump. Forces have different results depending on the frame time (the engine assumes that the force is applied for the duration of the frame).

    Setting the velocity has worked really well thank you!

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