How do I keep rigidbodies from pushing each other?
When both of my rigidbodies are set to dynamic they push each other like this. When I set one of them to kinematic like this it does keep them from pushing each other, but the problem is that kinematic rigidbodies don't collide with other kinematic rigidbodies they just phase through each other.
As a note, these things are available in the manual and tutorial sections.
Answer by BeefuMan · Apr 11, 2018 at 10:01 PM
Since I couldn't find a built in solution I made my own custom character controller. If anyone is interested in it here's a download link https://github.com/Bifumen/CharacterController2D
Answer by meat5000 · Apr 01, 2018 at 12:18 PM
You could add contraints to the rigidbody to hold it in position? You can just make one of the rigidbodies kinematic, like in your second gif. You can toggle Kinematics as you need them. Ignoring collisions will make them move through, of course.
There is this : https://docs.unity3d.com/ScriptReference/Rigidbody2D-simulated.html
But im not sure if this will ignore collisions (I assume you are using 2D)
But This : https://docs.unity3d.com/ScriptReference/Rigidbody2D-useFullKinematicContacts.html
should help you ("Should kinematic/kinematic and kinematic/static collisions be allowed?")
Your answer
Follow this Question
Related Questions
Should I use Rigidbodies in a top down 2D game if I don't need physics? 0 Answers
Unity2D Help with rigidbody character movement. 0 Answers
Character is drifting to left after start 0 Answers
Kinematic 2D Rigidbody movement: Rigidbody2D.MovePosition vs Rigidbody2D.position problem 1 Answer
Realistic Soccer VR 2 Answers