Тёмный

How to make Line of Sight in Unity 2D with Raycast 

Game Dev By Kaupenjoe
Подписаться 2 тыс.
Просмотров 4,7 тыс.
50% 1

In this Unity Tutorial we implementing a Line of Sight Script in Unity 2d using Raycast and Raycasting. Basically allowing the Player to hide behind Colliders and the Enemies to only follow if they have line of sight. This turns out to be quite easily done with Raycasts.
== LINKS ==
▶️ GitHub: github.com/Tutorials-By-Kaupe...
▶️ Starting Unity Package: url.kaupenjoe.net/gdbkj25/uni...
▶️ Unity Package: url.kaupenjoe.net/gdbkj26/uni...
▶️ Gist: url.kaupenjoe.net/gdbkj26/gist
== CREDITS ==
Character by: merchant-shade.itch.io/16x16-... by Merchant Shade under CC0
Tiles by: anokolisa.itch.io/dungeon-cra... by Anokolisa under CC0
Crab by camacebra.itch.io/crab-pixel-art by Camacebra under CC0
Bricks by bakudas.itch.io/generic-dunge... by Bakudas under CC0
== HASHTAGS ==
#kaupenjoe #unitytutorial #unity

Опубликовано:

 

3 сен 2023

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 13   
@yokami_9408
@yokami_9408 21 день назад
Waiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiit ! Kaupenjoe ! I remember following your minecraft tutorials :')
@fudgemerchant
@fudgemerchant 10 месяцев назад
Wow, this taught me so much in the span of just a few minutes. Thank you! Raycasting is gonna be super useful. I'm imagining it "should" work similarly in 3d probably. Hopefully...
@GameDevByKaupenjoe
@GameDevByKaupenjoe 10 месяцев назад
That's awesome to hear 😎💙 I am pretty sure the idea is exactly the same, just with that pesky added third dimension 🤣 Currently, I am not brave enough to venture into that, but maybe at some point 🙏🏻
@ArchAngelAzrael
@ArchAngelAzrael 10 месяцев назад
Thank you!
@GameDevByKaupenjoe
@GameDevByKaupenjoe 10 месяцев назад
Absolutely, had a blast making the tutorial. Turned out really cool 😁😁
@ipga13
@ipga13 10 месяцев назад
back when i started unity, raycasts seemed very daunting because the syntax is so long, now it seems like second nature
@GameDevByKaupenjoe
@GameDevByKaupenjoe 10 месяцев назад
Ye, I can fully understand that. There can also be quite a few nuances to get right. But overall, they are really cool and pretty useful 😁
@emilian_spielt300
@emilian_spielt300 6 месяцев назад
very nice tutorial, helped me out a lot. i have a question to your unity, how can you see all of the "scene" stuff in your game view? you see the line of sight and the colliders and stuff like this.
@GiangNguyen-ho5st
@GiangNguyen-ho5st 4 месяца назад
Is it possible to make it so that when the player is out of sight, the enemy would still run to the last seen position to look for the player?
@asleepcat
@asleepcat 2 месяца назад
Can you try to make this compatible with the ''A pathfinding'' project, because no matter how hard I try, I think I'm missing some things, can you please explain in detail how LOS would be compatible with this project, etc.? I won't say things like it's very watchable, but rest assured, I will watch the video until the end, even if it is 10 hours long. pls :'D
@georgekaragiozis3191
@georgekaragiozis3191 10 месяцев назад
Hey Kaupen! Could you make a simple AI that chases the player has lime of sight and when in range attacks the player (you can just make function Attack() or use comments in the video) in unity 3D with NavMeshAgent Great Video!
@GameDevByKaupenjoe
@GameDevByKaupenjoe 10 месяцев назад
Hey George, well I can definitely look into it - idk how fast I will be able to do something on this, but I have added it to my list of topics 🙏🏻🙏🏻
@georgekaragiozis3191
@georgekaragiozis3191 10 месяцев назад
@@GameDevByKaupenjoe Nice, thanks for responding.
Далее
How I made an Excellent Platformer
8:25
Просмотров 260 тыс.
I Made the Same Game in 8 Engines
12:34
Просмотров 3,9 млн
Nurse's dream !! 😂😂
00:17
Просмотров 5 млн
Using URP in Unity to make our Unity 2d Scenes Vibrant
10:20
Games Where You're NOT the Main Character
14:52
Просмотров 2 млн
Pathfinding - Understanding A* (A star)
12:52
Просмотров 119 тыс.
Recreating Darkwood's Vision Effect in Unity
4:01
Просмотров 47 тыс.
2D Top Down Movement UNITY Tutorial
7:21
Просмотров 217 тыс.
Creating SMART enemies from scratch! | Devlog
5:40
Просмотров 284 тыс.