Quazar3D: Master Tutorial
HomePreviousParentNext

Master Tutorial  »  10. Switching the camera and helicopter liftoff

10. Switching the camera and helicopter liftoff

test

Lesson 10

Complete lesson 09

This lesson will present how to change the camera type and how animate the helicopter takeoff.

  1. First in the Nodes window in the editor add two NodeDummy objects. From the upper toolbar press Add a Node and select Dummy Node . Name NodeDummy_0 object TPCAMERA_START_POSITION, name the NodeDummy_1 object CAMERA_TARGET. Place both objects under HELICOPTER_DUMMY. Change the position and rotation of both objects as follows:

    TPCAMERA_START_POSITION - Position (14,3384,9,6203, 10,0900), Rotation (-0,0856, 0, 0).
    CAMERA_TARGET - Position (0, 0,0043, 3,0100), Rotation (-0,8560, 0, 0).
  2. In the master_tutorial.fg find the Switch - step info block, open it and add output Checklist: completed.
test
  1. Find the Set String block, open it and add a new input. In Name enter Checklist: complected, in Value enter Wait as the helicopter takes off.
test
  1. Find the Set Integer block, open it and add new input. In Name enter Step 15, in Value enter 15.
test
  1. Add Container block, name it Takeoff. Open it and save it under HelicopterTakeoff name. Inside add SignalInput block, open it and in Create new enter setActive. Add Get Property block, open it and in Type enter Node [Data/Items/World], in Property enter WorldPosition  [Vec3]. Connect its Input to setActive in the SignalInput block. Form the Nodes window in the editor drag the TPCAMERA_START_POSITION on the Flowgraph window and connect it to Node in the Get Property. Add Vec3 block and connect it to WorldPosition in the Get Property block.
test
  1. Add Set Property block, open it and in Type enter Player [Data/Items/Players], in Property enter WorldPosition  [Vec3]. Connect its Input to Output of the Get Property block. Add PlayerPersecutor block and connect it to Player in the Set Property block. Connect the Vec3 block to WorldPosition in the Set Property block.
test
  1. Add Set Property block, open it and in Type enter Game [Data/Items/Engine], in Property enter Player  [Player]. Connect its Input to Output of the previous Set Property block. Add Game block and connect it to Game in the new Set Property block. Connect the Player in the new Set Property block to PlayerPersecutor block. Add Set Boolean block and connect its True to Output of Set Property block.  Add Boolean block, set it to False, name it isActive? and connect it to Result in the Set Boolean block.
test
  1. Add Timeline block, open it and in Add Input enter Node [Data/Items/World]. In Input properties change the name of the Data/Items/World/Node to Helicopter. To Helicopter add Property Position. To each line (X,Y,Z) add two points. Copy the values for each line from the image below. The points on the blue line (Z) are added as Spline function, for the remaining lines (X and Y) add point as Linear function.
lesson_10_screen_07
  1. To Helicopter add property Rotation. To each line add five points and copy the values from the image below. Points are added as Linear function.
lesson_10_screen_08
  1. Connect the Play in the Timeline block to Output of the Set Boolean block. From the Nodes window in the editor drag the HELICOPTER_FBX object to the Flowgraph window and connect it to Helicopter in the Timeline block. Add Remove WorldChild block and connect its Input to Finished in the Timeline block. From the Nodes window in the editor drag the helicopter_moving_platform object to the Flowgraph window and connect it to Node in the Remove WorldChild block. Connect the HELICOPTER_FBX block to Child in the Remove WorldChild block. Add SignalOutput block, open it and in Create new enter Completed. Connect the Output in the Remove WorldChild block to Completed in the SignalOutput block.
lesson_10_screen_09
  1. Add Init block, add Create PlayerPersecutor block. Connect the Output in the Init block to the Input in the Create PlayerPersecutor block. Connect the PlayerPersecutor block to Result in the Create PlayerPersecutor block. Add Set Property block, open it and in Type enter PlayerPersecutor [Data/Items/Players], in Property enter Target  [Node]. Connect its Input to Output of the Create PlayerPersecutor block. Connect the PlayerPersecutor block to PlayerPersecutor in the Set Property block. From the Nodes window in the editor drag the CAMERA_TARGET object on the Flowgraph window and connect it to Target in the Set Property block.
test
  1. Add Set Property block, open it and in Type enter PlayerPersecutor [Data/Items/Players], in Property enter MinThetaAngle  [Real]. Connect its Input to Succeeded in the previous Set Property block. Connect the PlayerPersecutor block to PlayerPersecutor in the Set Property block.  Add Real block, open it, enter 10 and connect it to MinThetaAngle in the Set Property block. Add Set Property block, open it and in Type enter PlayerPersecutor [Data/Items/Players], in Property enter MinDistance  [Real]. Connect its Input to Succeeded in the previous Set Property block. Connect the PlayerPersecutor block to PlayerPersecutor in the new Set Property block.  Add Real block, open it, enter 18 and connect it to MinDistance in the Set Property block.
lesson_10_screen_11
  1. Add Set Property block, open it and in Type enter PlayerPersecutor [Data/Items/Players], in Property enter MaxDistance  [Real]. Connect its Input to Succeeded in the previous Set Property block. Connect the PlayerPersecutor block to PlayerPersecutor in the Set Property block.  Add Real block, open it, enter 30 and connect it to MaxDistance in the Set Property block. Add Set Property block, open it and in Type enter PlayerPersecutor [Data/Items/Players], in Property enter Distance  [Real]. Connect its Input to Succeeded in the previous Set Property block. Connect the PlayerPersecutor block to PlayerPersecutor in the new Set Property block.  Add Real block, open it, enter 30 and connect it to Distance in the Set Property block.
lesson_10_screen_12
  1. Add Set Property block, open it and in Type enter PlayerPersecutor [Data/Items/Players], in Property enter ZFar  [Real]. Connect its Input to Output in the previous Set Property block. Connect the PlayerPersecutor block to PlayerPersecutor in the Set Property block.  Add Real block, open it, enter 12000 and connect it to ZFar in the Set Property block. Add Set Property block, open it and in Type enter PlayerPersecutor [Data/Items/Players], in Property enter ZNear  [Real]. Connect its Input to Output in the previous Set Property block. Connect the PlayerPersecutor block to PlayerPersecutor in the Set Property block.  Add Real block, open it, enter 1 and connect it to ZNear in the Set Property block.
lesson_10_screen_13
  1. Add SignalInput block, open it and in Create new enter setTPCameraActive. Add Set Property block, open it and in Type enter Game [Data/Items/Engine], in Property enter Player  [Player]. Connect its Input to setTPCameraActive in the SignalInput block. Add Game block and connect it to Game in the Set Property block. Connect the Player in the Set Property block to PlayerPersecutor block.
lesson_10_screen_14
  1. Go back to master_tutorial.fg. Connect the Checklist: completed in the Switch - step infos block to Checklist: completed in Set String block and to setActive in Takeoff  block. Connect the Completed in the Takeoff block to Step 15 in the Set Integer block.
lesson_10_screen_15
  1. Go to the editor and press Play, check if you can reach the step, where the camera changes and the helicopter takes off.

  2. The next step will show you how to create functionality responsible for the helicopter's flight.

 

 Previous lesson || Next lesson