• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!

GML Physics Collision With Inertia

hans

Member
I'm making a physics based platformer. I can't get it where when two objects collide they impart each others speed on one another. ie: if the player gets hit by a barrel with a speed of 4 I want the player to then also be moving with a speed of 4 with the barrel. Does anyone know how to make this happen?
 

Nocturne

Friendly Tyrant
Forum Staff
Admin
First, using physics for a platformer is not really a good idea, imho... The physics functions are meant to simulate real life interactions between objects, and in general, a platformer isn't very "real life"! That said, if you are using physics then you need to set up the restitution and linear dampening to ensure that instances bounce off each other correctly. Really, it's a combination of ALL the different physics properties that will determine how the collision is resolved, but those are the two main ones.
 
Top