Тёмный

How to Make NPCs/AI Run Away (with examples in Unity) 

Feed My Kids
Подписаться 721
Просмотров 11 тыс.
50% 1

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

 

26 окт 2024

Поделиться:

Ссылка:

Скачать:

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

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 20   
@RDD87z
@RDD87z 2 дня назад
by any chance do u've any idea how to make a really good sophisitcated escape npc. (should have same speed as player). so the npc just tries to trick the player velocity/direction you know like random zigzag or something. i'm trying to find the best way possible to make it really hard to the player to touch the npc. (even if it spossible but still challenging)
@H1tARun
@H1tARun 5 месяцев назад
Thanks a lot. I may be fiddling around with Godot, but you helped me a lot.
@FeedMyKids1
@FeedMyKids1 5 месяцев назад
Good! I'm hoping to make more videos soon and make them more software/engine agnostic.
@SuperRitz44
@SuperRitz44 Год назад
Do you know of any way to make it possible for the prey to turn left or right instead of only one angle? Possibly according to the position of the predator (if predator is more to your left, you go right, and vice versa)
@FeedMyKids1
@FeedMyKids1 Год назад
You can multiply the direction in which the prey is supposed to run with Quaternion.AngleAxis(degreesAwayFromOriginalAngle(negativeForLeft), Vector3.up). If you want to know which side the predator is on use Vector3.Dot.
@castlecodersltd
@castlecodersltd 3 месяца назад
Interesting, thank you 🙂
@BadgervanWyk
@BadgervanWyk 2 месяца назад
Your voice...... its beautiful
@edhalsim
@edhalsim Год назад
This is really good. I want to take this and turn the chaser into a walking humanoid downloaded from Mixamo. I tried adding an animator controller and got my guy to walk. But, when I tried adding a chaser script along with a nav agent, now my guy just goes bonkers. What am I doing wrong? Any help to my understanding would be greatly appreciated.
@KampinKarl1
@KampinKarl1 Год назад
Hi, check if on your animator component the Apply Root Motion box is ticked. If it is, untick it. It applies motion based on the animation and could conflict with the motion the navmeshagent is trying to apply.
@edhalsim
@edhalsim Год назад
@@KampinKarl1 Thanks for the prompt reply. When I have Apply Root Motion checked, but no chaser script or Nav Mesh Agent, it walks exactly how it's supposed it, just not towards the target. When I turn that off, but enable the script and Nav Mesh Agent, it follows the target, but it floats and glides rather than walks.
@Ytsssss364
@Ytsssss364 Год назад
@@edhalsim "When I have Apply Root Motion checked, but no chaser script or Nav Mesh Agent, it walks exactly how it's supposed it, just not towards the target" what? you downloaded an animation that actually *moves* eg "translates" moves across a distance? no no. you want to zero root so it's "walking in place" the navmesh strictly is making it move, enhanced by the script
@leothelion634
@leothelion634 2 года назад
Reminds me of World of Warcraft when enemies run away its annoying asf because they will run into another group of enemies and aggro them causing a 4v1 then I die
@FeedMyKids1
@FeedMyKids1 2 года назад
Ah, I never played WoW and figured anyone who uses this advice would create their own logic after turning their NPCs around.
@thegrey448
@thegrey448 2 года назад
hi thanks for make this video. i have different purpose how to make object run away when it clicked? thanks in advance.
@FeedMyKids1
@FeedMyKids1 2 года назад
Hi, Put a collider on your object so you can use Unity's built-in OnMouseDown callback (write OnMouseDown in your script and your IDE should give you an intelisense autofill for the method and the name of the method should show up in blue [as opposed to white]). Call the RunAway() or whatever method from within OnMouseDown.
@thegrey448
@thegrey448 2 года назад
@@FeedMyKids1 hi buddy thanks for your answered. i will try it. hopefully you could make tutorial for it. if you dont mind. thanks.
@thegrey448
@thegrey448 2 года назад
@@FeedMyKids1 hi budd , onmousedone so useful and i used settrigger for animator to animated. many thanks👌
@FeedMyKids1
@FeedMyKids1 2 года назад
@@thegrey448 Perfect! Glad it worked
@Ainn79
@Ainn79 Год назад
thanks a lot, you saved my ass
@FeedMyKids1
@FeedMyKids1 Год назад
Awesome! Glad to hear it.
Далее
How to make a Video Game - Godot Beginner Tutorial
1:17:12
Can AI code Flappy Bird? Watch ChatGPT try
7:26
Просмотров 9 млн
The Making of Karlson 2D (Game)
11:41
Просмотров 6 млн
Coding Adventure: Chess
29:22
Просмотров 3,8 млн
AI Learns to Play Tag (and breaks the game)
10:29
Просмотров 3,9 млн
How To Make A Game Alone
8:11
Просмотров 1,1 млн
C++ Developer Learns Python
9:26
Просмотров 2,7 млн
How to code SMARTER A.I. enemies | Unity Tutorial
32:49