- Home /
Missing animation that isn't actually missing
I have a script that detects when the player is within a collider and activates an animation for another object, which enables a GlobalFog image effect on the camera. Then when the player leaves the collider it disables the fog script. This worked for the first attempt. The issue is that when running the game it says the animation is missing, however the animation is in the assets folder in Assets/Animations/ and it's applied to the player camera (the target of the other script), as well as the other script, and set to NOT play automatically. The script:
using UnityEngine;
using System.Collections;
public class Underwater : MonoBehaviour
{
public GameObject player;
//public AnimationClip enableAnim;
//public AnimationClip disableAnim;
void OnTriggerEnter(Collider player)
{
animation.Play("enableGlobalFog");
//animation.Play(AnimationClip(enableAnim));
}
void OnTriggerExit(Collider player)
{
animation.Play("disableGlobalFog");
//animation.Play(AnimationClip(disableAnim));
}
}
Your answer
Follow this Question
Related Questions
collider animation problem 1 Answer
Mouse Over Wont Work on Bone Animated Meshes. 1 Answer
How to jump on to a turret gun 2 Answers
Collider Activate Trigger Animation 0 Answers
Trigger animation going crazy 3 Answers