sometimes when i spawn it spawns with it behind me, but sometimes it also occurs like in the screenshot
What solutions have you tried so far? Did you look for solutions on the Developer Hub?
well i have been looking around for a bit to see if their is anything that could help but i couldn’t find any information about this
local function EquipPet(Player, Pet)
local Character = Player.Character
if Pet ~= nil and Character ~= nil then
if Character:FindFirstChild(Player.Name.."'s Pet") then Character[Player.Name.."'s Pet"]:Destroy() end
if Character.HumanoidRootPart:FindFirstChild("AttachmentCharacter") then
Character.HumanoidRootPart:FindFirstChild("AttachmentCharacter"):Destroy()
end
Pet.Name = Player.Name.."'s Pet"
Pet:SetPrimaryPartCFrame(Character.HumanoidRootPart.CFrame)
local ModelSize = Pet.PrimaryPart.Size
local AttachmentCharacter = Instance.new("Attachment")
AttachmentCharacter.Visible = false
AttachmentCharacter.Name = "AttachmentCharacter"
AttachmentCharacter.Parent = Character.HumanoidRootPart
AttachmentCharacter.Position = Vector3.new(1, 1, 0) + ModelSize
local AttachmentPet = Instance.new("Attachment")
AttachmentPet.Visible = false
AttachmentPet.Parent = Pet.HumanoidRootPart
AttachmentPet.Position = Vector3.new(-1, 3.4, 0)
local AlignPosition = Instance.new("AlignPosition")
AlignPosition.MaxForce = 25000
AlignPosition.Attachment0 = AttachmentPet
AlignPosition.Attachment1 = AttachmentCharacter
AlignPosition.Responsiveness = 25
AlignPosition.Parent = Pet
local AlignOrientation = Instance.new("AlignOrientation")
AlignOrientation.MaxTorque = 25000
AlignOrientation.Attachment0 = AttachmentPet
AlignOrientation.Attachment1 = AttachmentCharacter
AlignOrientation.Responsiveness = 25
AlignOrientation.Parent = Pet
Pet.Parent = Character
end
end
Well, I’m not spotting anything but this is not a method I’m familiar with so I very well could be missing something in regards to how this works. The attachment positions would be relative. (To the right side of the player and left side of the “pet”). Have you tried not parenting the pet to the character? Just allow it to be in the workspace and see if that changes things.