Unity VR Tutorial: Prevent Head Clipping by adding Push-Back effect
Вставка
- Опубліковано 29 чер 2024
- In this tutorial I will explain how to prevent player peeking through walls adding push-back mechanism to instead move the player away from the wall.
Learn more from about Unity Game Dev in my video courses at:
courses.sunnyvalleystudio.com/
Scripts on Github:
github.com/SunnyValleyStudio/...
Join the discord:
/ discord
You can support me through Patreon:
/ sunnyvalleystudio
00:00 Introduction
00:29 Detection Head collision
04:38 Testing Wall Collision Detection
05:38 Adding Push-back effect
08:42 Pushing Camera away from the wall - Розваги
can you stop them from reaching through walls to grab items?
You could use the same logic to push the player when they try to put their hand through the wall (just like we do with the head). That being said I would consider a better solution to make "thicker" walls or to stop the hand representation (with the grab collider) to go through wall. It really depends on what would work for your game. Pushing away might not feel "great" for hands
Really good interesting stuff 🎉
Thanks 👍