简体   繁体   中英

|| Getting error while using Humanoid:MoveTo() on roblox

I'm getting an error trying to code a Roblox game i want a walking character that follows me so i put a local script into the dummy and did the following in the script:

while true do
    script.Parent.Humanoid:MoveTo(game.Players.LocalPlayer.Character.HumanoidRootPart.Position)
    wait()
end

-- Local Script is inside of a dummy

As you can see I did a while loop that loops it forever and inside of it I've got the humanoid from inside the Dummy and then did the inbuilt function and for the location, I got the players character and got the humanoid root parts position when I run the script it doesn't do anything nothing shows up in the console the dummy stays in the same position and doesn't move. I don't know how to fix this so please help.

What is the point of updating the target position of that Humanoid 30 times per second?

From what I found the default wait time is 0.03s. Using very short wait times is generally discouraged.

Pick a reasonable wait time of a few seconds.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM