- Home /
Stop box collider moving with object
Hey all, so basically I have tried doing a bit of googling and not found anything that is directly helpful to me, either way I have decided to post here.
Let's say I have a door, when the player steps into the trigger (box collider) the door opens, when the player leaves the box collider the door then closes, all great right? The problem I have is when the door animates open the box collider also moves with it.
For example, if the players stands infront of the door they are in the collider, as the door animates open the collider moves so even if the player doesn't move the door closes. What I want is for the box collider to always remain still and to not move with the animation, is this possible? Thanks!
You can put your door animation in the child of the collider object and animate the door relative to it's parent.
Answer by unidad2pete · Aug 27, 2017 at 10:08 PM
Select your door gameObject, press Ctrl + D to make a duplicate. On this copy delete all components except the box collider. On your original object, delete only the box collider.
Drag the original Object inside the copy, making the copy parent of the original.
I dont know where are your script with the trigger to open the door, but you only needs set trigger to the new box collider.
Tried, it works. I would have never thought about that myself. Thank you!
Your answer
Follow this Question
Related Questions
[Resolved]Animator.Rebind on instantiated child. 0 Answers
Running animation 1 Answer
animation control problem 0 Answers
teleporter not working due to animator 0 Answers
Have some minor problems. Cant tell if its a script issue or a animator issue. 1 Answer