i need to make a flying enemy. the mob has a humanoid and right now it just uses .position to fly but i want a proper fly script.
right not the script is crappy:
local body = script.Parent
local decor = body.Parent:WaitForChild(“decor”)
local origin = body.Position
local targetPos = game.ReplicatedStorage.values.torso.Value
local distance = (script.Parent.Position - targetPos).Magnitude
while true do
body.Position = origin-(origin-targetPos).Unit*0.8
decor.Position = origin-(origin-targetPos).Unit*0.8
wait()
end