Hello! I am creating a game Main Menu, and I need help creating a camera animation.
My idea is to make the camera move to another area when I click “Options” (GUI Text).
In my script the “cam” is my main camera that is being animated.
The “OptionAnim” is the camera animation itself.
MY PROBLEM : my problem is that the animation plays without the user clicking “Options”.
my other problem is that the animation keeps looping. (In the inspector…the “play automatically” is turned off).
Please help. Here is my script : (Please post a edited or fixed version with an explanation if you can!
var cam : Camera;
function OnMouseEnter()
{
renderer.material.color = Color.grey ;
}
function OnMouseExit()
{
renderer.material.color = Color.white ;
}
function Start()
{
Animation.WrapMode = WrapMode.Once ;
}
function Update()
{
if (Input.GetMouseButton(0)) ;
cam.animation.Play("OptionAnim");
}