Search Unity

Cinematics

Discussion in 'Community Learning & Teaching' started by angel38, Jan 23, 2011.

  1. angel38

    angel38

    Joined:
    Apr 13, 2009
    Posts:
    100
    Hi everybody,

    How I can do cinematics into the gameplay... in example... I switch a button, the camera show te opening door and come back to the player?

    Thank you in advanced.
     
  2. Feyhu

    Feyhu

    Joined:
    Sep 14, 2010
    Posts:
    211
    switch to a different camera and perform an animation
     
  3. angel38

    angel38

    Joined:
    Apr 13, 2009
    Posts:
    100
    Yes, but I mean, I want to move the camera to the door and then come back to the player... some tutorial or video?

    Is like the UDK cinematics. There is something like that?
     
  4. adikavoor

    adikavoor

    Joined:
    Mar 2, 2011
    Posts:
    6
    check out the 3d tutorial in the resources section..the lerpz one..one of the later chapters show how to do that. basically when an event is triggered, you need to make 2 things happen
    1. start playing the animation(of-course)
    2. switch to a different camera which is made to point at the object (in your case the door which is opening)
     
  5. adikavoor

    adikavoor

    Joined:
    Mar 2, 2011
    Posts:
    6
    oh and once the animation finishes you can switch back to the normal camera...
     
  6. softwizz

    softwizz

    Joined:
    Mar 12, 2011
    Posts:
    793
    I think what Angel38 means is that instead of switching to another camera, the camera following the player detaches from the player, moves through the game level and looks at the door opening, then moves back through the level to its original position watching the player.

    I am new to Unity but would expect the switch to trigger a camera move script that would perform the actions of moving the camera, dont ask me how to write this script because at the moment I dont have the faintest idea!
     
  7. adikavoor

    adikavoor

    Joined:
    Mar 2, 2011
    Posts:
    6
    in that case you need to perform actions on the transform : position and look at

    when the trigger is set, first change the lookat and set it to the new target
    Code (csharp):
    1.  
    2. transform.LookAt(target); //target is a vector3, has to be in the (x,y,z) format
    3.  
    and then move the camera position
    Code (csharp):
    1.  
    2. transform.position = position; //position is a vector3, has to be in the (x,y,z) format
    3.