I have a very simple script for an r6 rig in a tower defense game. It is supposed to move towards a total of 3 different points, however, when moving towards the second one, just a couple of studs away from the target position, it turns toward the last point and falls, btu it has not yet rea ched the target position, so I dont know what is going on.
local humanoid = script.Parent.Humanoid humanoid:MoveTo(workspace.TurnPoints.Start.Position) humanoid.MoveToFinished:Wait() humanoid:MoveTo(workspace.TurnPoints:FindFirstChild("1").Position) humanoid.MoveToFinished:Wait() humanoid:MoveTo(workspace.TurnPoints:FindFirstChild("2").Position) humanoid.MoveToFinished:Wait()
Well, there can be several things that can be creating the issue. Here, I am assuming that the problem is related to NetworkOwnerShip
. I think that the R6 is falling because of continuous change of network owner from the player to the server. To fix that :
-- Add this at the end line script.Parent.PrimaryPart:SetNetworkOwner(nil) -- nil = Server
If the above doesn't work, then : For debugging purposes, test the game by using 'Run' and not 'Play' and check whether the R6 is able to complete.
Lemme know if it helps!
MoveTo is not a thing . . . and you cant move a humanoid . . . you need to get the character HumanoidRootPart and then change it position
local player = game.Players.LocalPlayer player.Character.HumanoidRootPart.Position = vector3.new(0,0,0) --put your position here