Reader small image

You're reading from  Unity 5.x Animation Cookbook

Product typeBook
Published inMay 2016
Reading LevelExpert
PublisherPackt
ISBN-139781785883910
Edition1st Edition
Languages
Tools
Right arrow
Author (1)
Maciej Szczesnik
Maciej Szczesnik
author image
Maciej Szczesnik

Not interested. Too busy with current game project. Source: Linkedin.
Read more about Maciej Szczesnik

Right arrow

Changing the character's collision while crouching


In this recipe, we will learn how to change our character's collision while crouching. This way our character will be able to enter low areas (such as vent shafts).

Getting ready

We are going to use the same character as in the Using root motion to steer a character recipe with all its animations (Idle, WalkLeft, WalkForward, and WalkRight). Additionally, you should prepare those four animations in a crouch state (IdleCrouch, WalkLeftCrouch, WalkForwardCrouch, and WalkRightCrouch). We are going to use the RootMotionSteering.cs script from the preceding mentioned recipe. You also need an obstacle in your scene. It should have a passage underneath. The passage's ceiling should be low enough so that the character cannot go through it without crouching. We don't need any other scripts to start. You can also go to the Chapter 04 Character movement\Recipe 09 Changing the characters collision while crouching directory. You will find an Example.unity...

lock icon
The rest of the page is locked
Previous PageNext Page
You have been reading a chapter from
Unity 5.x Animation Cookbook
Published in: May 2016Publisher: PacktISBN-13: 9781785883910

Author (1)

author image
Maciej Szczesnik

Not interested. Too busy with current game project. Source: Linkedin.
Read more about Maciej Szczesnik