- Home /
How to Create an Immovable Object?
I want to create an object in my game (3rd person) that can't be moved, but the character can run into and be stopped (like a wall). I can't find any good tutorials, and my character keeps ending up walking through the object. Any suggestions?
Answer by TSI25 · Oct 12, 2017 at 09:22 PM
It depends a little bit on how your character is moving around in the world. Generally just putting a collider component on the object and making sure that its not set to be a trigger collider and that doesn't have a rigidody will do the trick.
if you are using .Translate or.position then you are literally just teleporting the player around and there isnt a physics check being done if I remember correctly. If you need physics interactions, you have to use CharacterController.Move or .SimpleMove, or use Rigidbody.AddForce
I had to remove rigidbody in my case and it worked! Sorry for replying on this old comment but thank you so much! :D
Your answer
Follow this Question
Related Questions
Tree collision 1 Answer
How to make tiles or gameobject solid? 2 Answers
Tree collision 1 Answer
Object Reference Exception (I'm getting sick of these) :P 1 Answer
Object rotation from web page values 1 Answer