Shooting a target behind an obstacle in Unity 3D using Raycast to ensure a clear shot
Shooting a target behind an obstacle. Using a Raycast to ensure a clear shot.
When using a ranged weapon, it's not enough to just approach the target up to the weapon range, but also to ensure that you have a clear shot.
To ensure a clear shot, I use a Raycast from the weapon to the target and continue approaching until a clear shot is possible.
Used colors:
yellow ray - clear shot is possible
blue ray - there is an obstacle
red ray - no obstacle and not target (happens if you try to shoot out of range, not possible with the current logic)
Current game progress playable as WebGl game at:
https://undeadswarm.com
#unitytutorial #gamedev #unity3d
Видео Shooting a target behind an obstacle in Unity 3D using Raycast to ensure a clear shot канала Maty
When using a ranged weapon, it's not enough to just approach the target up to the weapon range, but also to ensure that you have a clear shot.
To ensure a clear shot, I use a Raycast from the weapon to the target and continue approaching until a clear shot is possible.
Used colors:
yellow ray - clear shot is possible
blue ray - there is an obstacle
red ray - no obstacle and not target (happens if you try to shoot out of range, not possible with the current logic)
Current game progress playable as WebGl game at:
https://undeadswarm.com
#unitytutorial #gamedev #unity3d
Видео Shooting a target behind an obstacle in Unity 3D using Raycast to ensure a clear shot канала Maty
Показать
Комментарии отсутствуют
Информация о видео
Другие видео канала
![Fixing Broken Animations in Blender After Scaling a Model](https://i.ytimg.com/vi/2uCuaKRi1TE/default.jpg)
![Necromancer.io mobile trailer / preview video](https://i.ytimg.com/vi/iYAJo36Lt8s/default.jpg)
![Necromancer.io: Latest Build Preview | Exciting Updates & Enhanced Performance](https://i.ytimg.com/vi/peSvYyoLbcs/default.jpg)
![Necromancer.io - Introducing Level System, Control Points, and Fancy UI](https://i.ytimg.com/vi/5IpZZH-pyVg/default.jpg)
![Developing a Web-Controlled RC Car with NodeMCU under an HOUR, Guided by ChatGPT-4](https://i.ytimg.com/vi/Xu23XdYPsOw/default.jpg)
![Unleashing the Power of Necromancer AI in my Unity 3D RPG Game](https://i.ytimg.com/vi/cQZjSRAtwBY/default.jpg)
![Undead Swarm with better terrain, water, and bridges](https://i.ytimg.com/vi/4VhwAzEyZ2I/default.jpg)
![How to easily compare two GameObjects in Unity3D in two side-by-side inspectors](https://i.ytimg.com/vi/iJt9dCxPxws/default.jpg)
![Revenge of the Necromancer - the minions got smarter with behavior trees](https://i.ytimg.com/vi/QZi7A_qCfkE/default.jpg)
![Goblin AI with Behavior Tree](https://i.ytimg.com/vi/-aXY-COfJLA/default.jpg)
![Skeleton dramatic death animation (Unity 3D + Blender 3D Cell Fracture)](https://i.ytimg.com/vi/ZoV2I6dKo9s/default.jpg)
![Add new mixamo animation to already animated character in Unity 3D.](https://i.ytimg.com/vi/-DF1kO8-8u0/default.jpg)
![Goblin Massacre - new magic bolt for the necromancer](https://i.ytimg.com/vi/IphHYNhuc00/default.jpg)
![3D printed delta robot - sand artist / painter](https://i.ytimg.com/vi/dYGOQ_KJikg/default.jpg)
![Veggie Massacre - recording gore sound effects (sfx) for a game](https://i.ytimg.com/vi/I4iWU5vUFEo/default.jpg)
![The first minion - an undead skeleton warrior raised from a green goblin corpse](https://i.ytimg.com/vi/fRb96XXiKzw/default.jpg)
![How to fix character floating above the ground when using NavMesh in Unity 3D](https://i.ytimg.com/vi/-xMA2eiJsmk/default.jpg)
![The green Goblin - a vicious monster inhabiting the entry levels of the dungeon (Undead Swarm RPG)](https://i.ytimg.com/vi/HSlF5x20T9A/default.jpg)
![Tips & Tricks on how to resolve the most common problems when importing Mixamo animations in Unity3D](https://i.ytimg.com/vi/bB4stMl6P5w/default.jpg)
![Making glowing eyes in Unity 3D](https://i.ytimg.com/vi/sHjOJzylLdo/default.jpg)