In this Unity game development tutorial we’re going to look at how we can prevent a character from bouncing, when moving down a slope.
We’ll start off by explaining why the character bounces when moving down a slope, and then explain how we’re going to solve the problem.
We’ll create a method that will detect whether the character is on a slope using a Raycast. Then we’ll rotate the velocity to align it to direction the slope.
The project files are available to our patrons here:
► https://www.patreon.com/posts/54017553
Want to follow along? This project is a good starting point
► https://www.patreon.com/posts/48966441
The final script is available for free here
► https://dotnetfiddle.net/VpfYvo
Help support our work:
► Patreon: https://www.patreon.com/ketragames
► Ko-fi: https://ko-fi.com/ketragames
Follow us:
► Ketra Games: http://www.ketra-games.com
► Patreon: https://www.patreon.com/ketragames
► Twitter: https://twitter.com/ketragames
► Facebook: https://facebook.com/ketragames
Introduction – 0:00
Overview of starting project – 0:24
Script to align velocity to the slope – 1:39
Summary – 4:27
#KetraGames #LearnUnity #UnityTutorials #UnityTips
Voir sur youtube