I’m wanting to get thoughts on using PathfindingServicefor a pet system? My current system utilizes BodyPosition and BodyGyro, which are meh. Problems I have with these is they aren’t great for ground based pets. They give off a floating vibe, like the animal is hovering, and not actually walking, like a natural animal. So when I turn 180 degrees and head the opposite direction, the pet basically goes on a diagonal trajectory, phases through my body.
The pet naturally stays by your right hand side.
Example of my current predicament
Sketched out, here’s the visual problem
So when I turn around 180 degrees, instead of the pet moving in an arch, like a naturally animal would, it kinda just “hovers” over to my that position, thus making the pet move basically backwards, and rotating them on a pivot at the exact same time. The pet should never just rotate on a pivot 180 degrees. No animal does that. A dog for example is gonna arc around to get to a position behind them. Not walk backwards on an angle, and rotate on a pivot at the same time.
If pathfinding is not recommended, then what else can I use? Almost all tutorials online use BodyMovers, however they seem to only useful for simulator pets (pets that hover and don’t have legs, thus can rotate on a pivot without it looking strange)
Is my current code
local RotatedOffset = HumanoidRootPart.Position + (((HumanoidRootPart.CFrame - HumanoidRootPart.CFrame.Position) * CFrame.Angles(0, math.rad(90), 0)).LookVector * -6)
local Params = RaycastParams.new()
Params.FilterType = Enum.RaycastFilterType.Blacklist
Params.FilterDescendantsInstances = {CurrentPet}
Params.IgnoreWater = true
local ToFloor = workspace:Raycast(
RotatedOffset,
Vector3.new(0, -20, 0),
Params
)
if not ToFloor then return end -- Not floor found
local _, BoundSize = CurrentPet:GetBoundingBox()
local YPos = ToFloor.Position.Y + (BoundSize.Y / 2) + 0.2
BodyGyro.CFrame = HumanoidRootPart.CFrame
BodyPosition.Position = Vector3.new(RotatedOffset.X, YPos, RotatedOffset.Z)