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