Search Unity

Pause player movement during animation

Discussion in 'Editor & General Support' started by atomicpang123abc, Apr 29, 2013.

  1. atomicpang123abc

    atomicpang123abc

    Joined:
    Apr 12, 2013
    Posts:
    15
    Is it possible to not allow players to move the camera and move during an animation?
    My situation is that the game starts and the main camera has an animation that play's, my problem is that i don't want the player to be able to move the camera or walk around during the animation until the animation has finished playing.

    If you can, please help me with this situation and if you need any additional information from me to fix this issue please don't be shy to ask. Thank you for your time and help!
     
  2. paracosm

    paracosm

    Joined:
    Apr 2, 2013
    Posts:
    44
    If you are using the default first or third person character control scripts, inside the Character Motor script is a boolean for "Can Control". With a script you should be able to toggle this on and off at different points in your initial camera animation.

    There is a function inside the script called setControlalble(controllable : boolean) that you should be able to toggle within the animation itself using event keys.

    http://docs.unity3d.com/Documentation/Components/animeditor-AnimationEvents.html