- Home /
Other
Character collider with House won't work
I have a character and it won't collide with a house. Both are assets off the Unity Asset Store. I have a ridgidbody collider and a capsule collider on my character, on the house (On the main house, not individual boards and windows) I have a box collider, but they won't collide at all! Any help?
Will need more info here, how are you moving your character? When you say it won't collide, do you mean that OnCollisionEnter() isn't called or do you mean that your character is moving through the walls of the house?
Answer by lgarczyn · Jan 03, 2020 at 08:48 PM
You shouldn't use both a rigidbody and character controller on the same object.
Answer by logicandchaos · Jan 04, 2020 at 05:22 AM
There could be many things wrong with it can you post your code and show the inspector for both objects? Can you describe the problem in more detail, do the objects pass through each other or are you trying to make a collision trigger in code? Both objects need a collider that sounds good, they must both be 3d or both 2d, and one of the objects needs rigidbody also 2d or 3d to match the rest. You can check if the trigger checkbox is selected on with colliders as well.
The Character passes through the house, I am not trying to use collision triggers in code. The character has a rigidbody and a collider, the house only has a box collider. The "Is Trigger" checkbox is NOT checked on either collider. Thanks here are my inspectors below...
Please post the code used to move the rigidbody. If you use transform.position, rigidbody.position or rigidbody.$$anonymous$$ovePosition, it will pass through objects.
This is the only code I am using attached (Pumpkin$$anonymous$$ingController script) to control my character. I don't know if this helps?
Follow this Question
Related Questions
my thing keeps going through walls, but ridged bodies can touch the collider 0 Answers
Colliding fast moving object with a slow moving object 1 Answer
Can two different composite colliders collide? 0 Answers
How to detect if target is inside an "arc" area? 0 Answers
what do you think of my models 0 Answers