# Use of PathfindingService for realistic animals?

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)
``````
4 Likes

Well, the animal uses some kind of BodyMover? If it uses, then Pathfinding cannot be used. That is because pathfinding works only for animated and Roblox’s builded rigs (normal characters)

1 Like

Ye, that’s why I’m asking what would be a better option? I wanna use whatevers gonna work best

Well AFAIK I do not think you can solve that issue. Many simulators have pets and all of them ith the same engine have thsi issue. You can solve this issue by creating characters pets, like Adopt Me did. Then you can use Pathfinding.

Well I’m trying to create a pet system similar to Adopt Me or Overlook Bay

Well not exactly, you could place the animal in a normal roblox character mesh, delete the arms and legs and make the head and torso invisible

No clue what you are on about here??

Wrong post sorry unsure how it got put here

Lol no. Pathfinding can be used to find waypoints from any
Start Vector3
to any
End Vector3
Then it’s up to you how to move your part to those waypoints. Read Intro to pathfinding. @octav20071, @NinjoOnline.

1 Like

I’m not sure that this would work, but I think you could use a bezier curve and bodymovers to move the pet more realistically.