- Home /
Question by
Coreyf716 · Oct 10, 2012 at 12:53 AM ·
animationcamerajavascript
Disabled Camera After Animation Finishes
I'm trying to program a camera.
function Start () {
FirstPersonCam.enabled = true;
AimCam.enabled = false;
}
var FirstPersonCam : Camera;
var AimCam : Camera;
function Update () {
if(Input.GetMouseButtonDown(1)) {
AimCam.enabled = true;
animation.Play("ZoomIn");
}
if(Input.GetMouseButtonUp(1)) {
animation.Play("ZoomOut");
}
}
I need to be able to disable the AimCam after the 'ZoomOut' animation has finished playing. I'm still very new with coding. How can I write this in the GetMouseButtonUp function?
Comment
Answer by hvilela · Oct 10, 2012 at 01:17 AM
Use Animation Events to call a method to re-enable your camera.
Boolean functions can not be added to animation events according to the document. How would I write it in code?
Your answer
Follow this Question
Related Questions
Wait() is not working for me! 2 Answers
fps MouseLook with animation applied to camera. 1 Answer
Play anim, javascript 1 Answer
animated camera position and free look 0 Answers