im have a bit of a problem, i’m trying to open a door with collider and using a animation clip to open and close the door.
-heres the code i have so far-
function OnTriggerEnter (other: Collider){
animation. play(“dooropen”);
Debug. log (“you hit the collider”);
}
function OnTriggerClose (other: Collider){
animation. play(“doorclose”);
Debug. log (“you exit the collider”);
}
what am i missing… please help
yea i tried that but still not working…
Did you assign the animations in the inspector? What level is the script and what level is the animation? If the animation is on the door which is a child of the building and you attach the script to the building you will have to fetch it.
– fafase