I’m working on a Follower // Pet system, however I’m having some difficulties maintaining a constant speed between the Player & Pet.
As shown below, my follow system results in a some-what jittery movement - I’m looking to have the Pet follow the Player itself rather than follow behind or alongside (As done in Loomian Legacy).
I’ve tried all sorts of different methods and had no luck as of yet - Does anyone have any suggestions?
local Distance = (HumanoidRootPart.Position - _PetModel:WaitForChild("Walker")["Torso"].Position)
local Magnitude = Distance.Magnitude
if Magnitude > (_PetModel["Obj"]["Base"].Size.X / 2) + 1 then
CanFollow = true
print("FOLLOW")
elseif Magnitude < (_PetModel["Obj"]["Base"].Size.X / 2) + 1 then
CanFollow = false
print("STOP")
end
if CanFollow then
_PetModel["Walker"]["NPC"]:MoveTo((HumanoidRootPart.CFrame * CFrame.new(Vector3.new(0, 0, 0))).p)
else
_PetModel["Walker"]["NPC"]:MoveTo(_PetModel["Walker"]["Torso"].Position)
end
Hmm, Maybe Trying changing the rotation to where ever the player is at so it looks at The player Because from your example seems like it works fine the only issue is not getting close and not turning and also if the player is in the mag it doesn’t move and try moving the pet closer to the player
From the desired example video, it looks like they only move the pet once the player is a certain distance from it, although the pet faces the player constantly.
I think using moveto is fine. I would try to only start the pet moving, when you are farther away from it, than the distance it will end up, when it follows you.
For example, only start the pet following when it is 10 studs away, but once it starts to follow, it will follow only stopping when it is 5 studs from you.