x


Box Collider not moving with animation

Hi there, hope this question hasn't been asked before already (had a look and I couldn't find anything).

Basically I have a door modeled in maya with an opening animation attached, I exported this to unity as a fbx with an heirachy of the door and the handles which are also animated.

I'm using a box collider on the door then through raycast and tags to trigger the animation.

Everything seems to work but unfortunately for some reason the box collider doesn't move with the animation so even the door is open I can't walk through to the other side (I can walk through the door now though, which obviously doesn't help).

I think I'm probably missing out something obvious but can't seem to fix this, any help would be appreciated!

Thanks in advance!

more ▼

asked Oct 29 '10 at 11:10 AM

Allan gravatar image

Allan
19 3 3 6

(comments are locked)
10|3000 characters needed characters left

1 answer: sort voted first

The animation only moves the mesh being displayed, it does not change the transform of the object, which you have applied the boxcollider to.

If it is only a simple open animation I would definitely suggest not using animations to turn the door, but modifying the rotation directly from script.

If you still want to use the animation, or need to do animation for something that's a bit harder to use scripting for, such as a whole character, you can attach primitive colliders to bones, and they will follow the animation.

Hopes this answers your question

more ▼

answered Oct 29 '10 at 12:15 PM

Atnas1010 gravatar image

Atnas1010
1.1k 6 10 26

Hi Atnas, thanks for the explaination...I couldn't solve it in the end so I re-animated the door in Unity.

I guess I was trying to figure it out as I was worried I couldn't get my character animations working also down the line. I'll try what you said about attaching primitive colliders to bones though, thanks for the help!

Nov 03 '10 at 10:34 AM Allan
(comments are locked)
10|3000 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Topics:

x3922
x1762
x200
x170

asked: Oct 29 '10 at 11:10 AM

Seen: 2992 times

Last Updated: Oct 29 '10 at 11:10 AM