Город МОСКОВСКИЙ
00:05:59

How to make NPC follow a player in Roblox game dev studio? 2021 #robloxdev

Аватар
Геймерский Уголок
Просмотры:
28
Дата загрузки:
29.10.2023 23:09
Длительность:
00:05:59
Категория:
Обучение

Описание

Tutorial for making humanoid move to and follow target Part in Roblox game development. I used this method to make a horror scene for Halloween. How to learn making games on Roblox?

Quick summary:
1. Humanoid has a method called "moveTo"
2. This function takes 2 parameters.
3. The first parameter is for position and the second is for a part.

My code snippet:
```
function handleFollowEvent(player)
local humanoidRootPart = player.Character.Humanoid.Parent.HumanoidRootPart
script.Parent.Humanoid:MoveTo(
humanoidRootPart.Position,
humanoidRootPart
)
end
```

Follow me for upcoming educational content:
https://twitter.com/codegodzilla
http://tiktok.com/@codegodzilla

Рекомендуемые видео