- Home /
BoxCollider not moving along with the gameobject
I have attached a boxcollider to the gameObject and whenever I swipe up(vertically) the gameObject,the object moves to a certain height but the collider tends to be on the ground itself. What is the possible reason for it and how can I solve this.
That sounds a bit weird.I'd say try checking if your collider is actually part of your game object.Or you can create an empty game object call it something like "boxCollider" and then attach the box collider to it.$$anonymous$$ove your created empty game object over your actual object and make the "boxCollider" a child of your main game object.
A box collider is a component, not an object. It doesn't have its own transform. Therefore, it cannot be moved separately from the object it is attached to (it can only be offset via script or inspector). Something is going on that isn't as you described it. Are you using any scripts?
Answer by zzeeshann · Jun 06, 2016 at 07:15 AM
If you are using animation add the collider to the child of the mesh e.g Hips
Answer by advancexz · Aug 31, 2016 at 07:56 AM
I know its an old thread, but I had a similar issue with BoxCollider2D and the thing was that my collider was a child with a RigidBody2d, I just removed the RigidBody and problem solved.
Hey I know this is an old comment.. but you solved my problem - thank you!
and thank you OP for asking this specific question.
Answer by $$anonymous$$ · Jul 08, 2013 at 02:01 PM
Ok so I assume that you didn't describe everything we needed to know. But don't worry I'll try to help you. Just follow the steps on moving the Gameobject with a box collider upwards.
Step 1: Click 'Add Component' then --> 'Physics' then --> 'Box Collider'

Step 2: Drag the object around and the Box Collider moves with it because it is a Component

Step 3: Works with multiple objects too :P
If this doesn't work well then you have a problem and need to read completely this page http://docs.unity3d.com/Documentation/Components/class-BoxCollider.html . Please if you liked my answer, check out our alpha game that's coming out this Wednesday at http://humanityfalling.weebly.com/ . Please join us if you want.
Your answer