Help with pet system movement

I want to make the pets closer to the character if there are fewer pets equipped, and if there are a lot of pets equipped, the pets will be further away from the character. I also want to make the bigger pets hit the ground properly just like the small dogs in the video.

Video:

I hope you can help me.

You can probably multiply X and Z by the number of pets equipped.

For the pets spawning further away, are you wanting them to spawn in further outer rings, or just make them all further in general

For the big one being inside the ground, you can run model:GetBoundingBox() and offset it by half the y value

Hello there, I remember making the post about this 2 years ago, I guess time flies. So in order to adjust the distance away from the character is change the scalar in the getXAndZPositions. Which would go like this:

local function getXAndZPositions(angle, scalar)
	local x = math.cos(angle) * scalar
	local z = math.sin(angle) * scalar
	return x, z
end

--> Then you just call the function like this
local X, Z = getXAndZPositions(
    Index * (FullCircle / #PetTable),
    your_number_here
)

And for the other issue, you just simply weld an anchor point beneath the pet and move that part instead of moving it from the centre position.

1 Like

Sorry for the late reply, I will mark you as a solution later when it works thank you.

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.