I’m working on relatively simplistic AI for my game’s entities. This particular version is giving me heavy trouble, though.
For some reason, this particular entity (an R6 rig) isn’t moving correctly to the desired position set by Humanoid:MoveTo(). (Offset by about 0.5 studs, and not moving right up to the spot)
Humanoid:MoveTo() IS being called (every frame),
it IS updating correctly (every frame),
the entity DOES move when pushed away (but still walks back to the wrong point, for some reason),
I’ve tried searching for solutions on this forum (albeit to no success), I’ve tried manually setting Humanoid.WalkToPoint (to no success either, same issue if not more frequent(?)),
After that, you should include more details if you have any. Try to make your topic as descriptive as possible, so that it’s easier for people to help you!
The main problematic part of the script stems from this excerpt. It’s intended to make the entity move to the last spot it saw someone. I’m doing distance checks instead of WalkToFinished or whatever event is used, as I’ve found it to be kind of buggy in my code (Firing multiple times on the same frame, firing out of nowhere, etc)
State = "Chasing"
print("Moving to last seen spot, particularly:", LastKnownPosition)
Entity.Humanoid.WalkSpeed = EntityStats.RunSpeed.Value
Entity.Humanoid:MoveTo(LastKnownPosition)
workspace.Location.Position = LastKnownPosition
if CheckDistanceFromDestination(LastKnownPosition) then -- To clarify, the distance check is .25. I'm keeping it at .25, as it could pose issues for pathfinding in geometry with many corners if too high.
LastKnownPosition = nil
State = "SearchingStart"
end
This is my first forum post, so it may be a bit sloppy.