- Home /
More realistic physics on child collisions 2D
I have a player character that has a head, a body and legs with the body as parent to legs and head.
I have the character sliding down a slope which in some places forces the player to duck otherwise the head will hit hanging stuff.
The problem is when the head is colliding with something the character just completely stops when using the built in collision system.
What i want to happen is what i drew in the image below. A more realistic collision where the head is forced backwards while the overall momentum is still forward which causes the character to land on the back and keeps sliding.
What is i tried so far is:
_player.PlayerHead.HeadRigidbody2D.AddForce(-_player.PlayerRigidbody2D.velocity * 500);
_player.PlayerHead.HeadRigidbody2D.AddTorque(-500);
But the results have always been that force goes in the wrong direction or that the entire character i forced backwards not just the head.
Your answer
Follow this Question
Related Questions
Multiple Cars not working 1 Answer
Distribute terrain in zones 3 Answers
Calling a Collision from code OR not simulating drag/gravity 0 Answers
Edge Collider issue 1 Answer