Nerd For Tech
Published in

Nerd For Tech

Creating Player Roll Behavior

2.5D Game Development

Objective: Allow player to roll on the ground

To do the animation, we first need the animation itself so we go to mixamo.com and select the animation we like

Now download the animation with following settings

After the download, we need to configure it to work in our game so we first drag the downloaded animation in the unity, select the file and change to following

After you set this setting, select apply to save the settings. Then expand the file and you will be able to see various files and among them is the animation file so select the file with the animation name and cop it with Ctrl+D.

Then drag that animation inside your animator to set the animation conditions.

Make the transaction from run with a condition of bool value true and from rolling animation to idle with condition of bool value false.

Then inside the Update function of Player script, we need to set the conditions which will enable the rolling animation which in this case is when player holds S key and presses Space bar when in running motion.

And this is the final result.

--

--

--

NFT is an Educational Media House. Our mission is to bring the invaluable knowledge and experiences of experts from all over the world to the novice. To know more about us, visit https://www.nerdfortech.org/.

Recommended from Medium

Fortron Smart Contract — Earn Unlimited TRONs with Fortron, An upcoming TRON based smart contract…

Why I chose to attend FlatIron and become a Software Engineer

Why API Management is required for a business? — Part III

Multiple Images in Single Container Docker setup for Nvidia Cuda

Python Decorators for Smileys — Part 1

Containerized Automated Tests in AWS

Starting All Over — The best way to approach your programming Journey

Makers Academy, week 5

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Niraj Karki

Niraj Karki

Unity Developer

More from Medium

How to Make the Camera Shake Using Impulse Listener Extensions in Cinemachines Virtual Cameras

From Prototype to Art

Adding a Main Menu to our UI

Creating a Shop