Hey guys, I’m @refightx. I’m trying to make an animal system, but I’m having trouble with one line.
while task.wait(LoopTime) do
for i, Animal in pairs(Wildlifefolder:GetChildren()) do
if Animal.Humanoid.Health == 0 then print("Here") return end
local moveanimalmodule = require(Animal.MoveAnimalModule)
print(Animal.Humanoid.MoveDirection.Magnitude)
if Animal.Humanoid.MoveDirection.Magnitude > 0 then coroutine.wrap(LoopThroughPlayers)(Animal, moveanimalmodule) return end
coroutine.wrap(LoopThroughPlayers)(Animal, moveanimalmodule)
if Attacking == true then return end
PickRandomWaypoint(Animal)
if path.Status == Enum.PathStatus.Success then
coroutine.wrap(LoopThroughPlayers)(Animal, moveanimalmodule)
coroutine.wrap(moveanimalmodule.MoveThroughAnimalWaypoints)(path)
else
warn("Not working")
end
end
end
the problem is these 2 lines.
print(Animal.Humanoid.MoveDirection.Magnitude)
if Animal.Humanoid.MoveDirection.Magnitude > 0 then coroutine.wrap(LoopThroughPlayers)(Animal, moveanimalmodule) return end
It is always 0 no matter what.
My model is properly rigged, it does move to where I want it to go, Im using :MoveTo(), And it is a custom rig. Is there any other way to see if the model is moving?
Any help is appreciated. Thank You!