Player pushes object but gets pushed into the Wall/Boundary
hello I'm having problem with OnControllerColliderHit my code I found it from an answer on the forum I just copied it from a documentary sample from what the answers were suggesting me (link: https://docs.unity3d.com/ScriptReference/CharacterController.OnControllerColliderHit.html) After pasting the code and testing the game I was happy to see my object gets pushed by the player but minutes later of all the game play I spent I discovered that there's another problem what the sample never told me about I was able to push a wall with the method I used but as I go backward and go forward pushing the object again I can push the object in to an obstacle (that can't be moved) and I don't want my object to get pushed in to the wall any fix for that?
hello, share screen shots from both objects please inspector, since it is probably a trigger, kinematic or something like that issue.
dont think thats the problem, but can you try giving the blue object a rigidbody too?
Sure no probs.... I added the Rigidbody to the Player and the problem is now fixed you're my hero now. I thought Character Controller and Rigidbody components don't need to be together on the Player object I heard someone said that it won't work but it did fix the problem so I guess they were wrong ahahah
Your answer
Follow this Question
Related Questions
Special collision for players 1 Answer
How to smooth the movement of the camera? 0 Answers
Boat Controller Help 0 Answers
fps script not working 1 Answer