У нас вы можете посмотреть бесплатно How to Make NPCs/AI Run Away (with examples in Unity) или скачать в максимальном доступном качестве, видео которое было загружено на ютуб. Для загрузки выберите вариант из формы ниже:
Если кнопки скачивания не
загрузились
НАЖМИТЕ ЗДЕСЬ или обновите страницу
Если возникают проблемы со скачиванием видео, пожалуйста напишите в поддержку по адресу внизу
страницы.
Спасибо за использование сервиса ClipSaver.ru
In this video you'll learn how to make one object "run away" from another. Hopefully, you'll learn a little vector math with simple examples. To sum up the entire video: 1. Get the direction to the object you're running from. (Dir = Obj2 Pos - Obj1 Pos) 2. Negate the direction (Dir = -Dir) 3. Run in that direction (Obj1.RunToPos (Obj1 Pos +. Dir)) 4. Scale the direction if you want by normalizing the direction vector. (Dir = Dir.normalized) 5. Run a certain distance away using the normalized direction. [Obj1.RunToPos(MyPos + (Dir * desiredDistance))] You'll need a copy of Unity for this: Try getting a version higher than Unity 5.6 The code, materials, and prefabs from this video can be found here: https://github.com/KampinKarl1/Unity-... Icons from Flaticon.com: The hen and fox are from FreePik Song: When All of This is Over by The Westerlies