Posts

Showing posts from January, 2022

How to Collect Items - Unity Game Development Tutorial

Image
In this Unity tutorial we're going to look at how how to pick up collectables when the player collides with them.

High Jump and Low Jump - Unity Game Development Tutorial

Image
In this Unity tutorial we're going to look at how we can make our character do a high jump when the jump button is held down, and a lower jump if the button is released early.

Recentre the Camera on Key/Trigger Press Using Cinemachine - Unity Game Development Tutorial

Image
In this Unity tutorial, we're going to look at how we can use Cinemachine to recentre the camera when a key or the right trigger of the gamepad is pressed. You can either watch the video version below or continue reading for written instructions. In a previous tutorial , we showed how to create a third person camera using Cinemachine. In that tutorial, we set up the camera to automatically recentre, to face the direction the character is moving after a period of time. We're going to change this behaviour to have the camera recentre when a key or the right trigger of the gamepad is pressed. The first thing we need to do is select the virtual camera in the Hierarchy, and disable the 'Recenter to Target Heading' setting. This will stop the camera automatically recentering. While we're here, we’ll also change some of the other settings. When we press the button, we want the camera to recentre immediately, so we’ll set the 'Wait Time' to zero. We'll