Hey I was working on a pet system recently for an RPG game and this is the simplified pet equip system that I made
It uses align position and align orientation to position the pets around the character. When you fire the equip remote just specify which position the pet is going to go in (1,2,3,4) and thats it. You can mess around with the values of the align position and align orientation to make it better.
Read more here
local Positions = {
[1] = Vector3.new(4,0,0),
[2] = Vector3.new(0,0,-4),
[3] = Vector3.new(-4,0,0),
[4] = Vector3.new(0,0,4),
}
game.Players.PlayerAdded:Connect(function(Player)
Player.CharacterAdded:Connect(function(Character)
for i,v in pairs(script.Parts:GetChildren()) do
local Part = v:Clone()
local Attachment0 = Instance.new("Attachment")
Attachment0.Parent = Part
Attachment0.Name = 'Attachment1'
-- This is where the specified number has to go [i]
Attachment0.Position = Positions[i]
Part.Parent = Character
local Attachment1 = Character.HumanoidRootPart:WaitForChild("RootRigAttachment")
local AlignPosition = Instance.new("AlignPosition")
AlignPosition.Parent = Part
AlignPosition.Attachment0 = Attachment0
AlignPosition.Attachment1 = Attachment1
local AlignOrientation = Instance.new("AlignOrientation")
AlignOrientation.Parent = Part
AlignOrientation.Attachment0 = Attachment0
AlignOrientation.Attachment1 = Attachment1
end
end)
end)
I tried new things but I still have problems with the positions of my facePart, sometimes it is “bumbed” in front but it never have the great position.
I tried to remake the facePart but it still doesn’t work.
I tried to remove and to remake the weldConstraint but I still have the same problem.
And I tried to weld other parts on the pets and the other parts worked