Unity Game Development Creating a Third Person Game
Class overview Class 4 Revision Third Person Camera Player Movement Camera Movement Camera Rotation Camera LookAt Camera Zooming Importing Assets Animation BlendTree Advanced: Animation events Advanced: Contextual sound using Raycasting
Revision Raycasting – Camera-to-World NavMesh Baking & NavMesh Agent Click Visualisation Camera Movement Importing 3D models Animation timeline Animation events Animator Raycasting – GameObject-to-GameObject Enums – Player States Advanced: Applying Damage
Third person Camera Camera is behind player in the Z axis. Camera can rotate around Player on Y axis and X axis. Camera looks at Player.
Player Movement Implement Horizontal and Vertical Player Movement. Implement Jumping logics.
Camera Movement Camera Position = Camera Target (Player) + Camera Offset
Camera Rotation Use Mouse Axis to increase Rotation Clamp Rotation X Multiply Rotation with Camera Offset Add up with CameraTarget and assign to Camera Position
Camera Lookat LookAt function will face an object towards it’s target.
Camera Zooming Mouse ScrollWheel Axis can be used to Zoom in / Zoom out. Value should be clamped to prevent Camera going too far forward / back.
Importing Assets Download Assets Import Asset Folder Place Ellen Model in Scene Setup Animations for looping Create Animator
Animation Blendtree Setup Animation Blend Tree with Movement Parameters
Advanced: Animation events Setup Animations Events for Footsteps (0 = left, 1 = right) Play Sound Effect per Step
Advanced: Contextual sound using Raycasting Raycast from Foot to Ground Play sound based on ‘tag’
Q&A Do you have any questions related to the topics mentioned?