- Home /
Camera Animation plays once
Hey Im using this script
var cam : Camera;
function OnMouseEnter()
{
renderer.material.color = Color.grey ;
}
function OnMouseExit()
{
renderer.material.color = Color.white ;
}
function OnMouseDown()
{
if (Input.GetMouseButton(0))
{
cam.animation.Play("CameraCar");
}
}
to play a camera animation after I have clicked on a 3d text. It works fine just that if I want to click on the 3d text agein afterwards it wont repeat the animation.
Comment
I had tested your code. It worked just fine. $$anonymous$$aybe there is something wrong in the animation? Try changing the animation wrap mode to "loop" and see if the animation is looping, so that you know that if the animation is looping then that's not the problem.
can it be becouse of this script i have ?
var cam : Camera;
function On$$anonymous$$ouseEnter()
{
renderer.material.color = Color.grey ;
}
function On$$anonymous$$ouseExit()
{
renderer.material.color = Color.white ;
}
function On$$anonymous$$ouseDown()
{
if (Input.Get$$anonymous$$ouseButton(0))
{
cam.animation["CameraCar"].speed = -1;
cam.animation["CameraCar"].time = cam.animation["CameraCar"].length;
cam.animation.Play("CameraCar");
}
}