◦Solved ⁙ Align Position & Align Orientation Collision Problem ⁙

⁝ Context

I’m constructing my own Pet System where you’ll be able to crack open an egg and obtain a Common - Legendary Pet!

ㅤㅤㅤ

⁝ Problem

My pet floating system works well though not the collision. I’m using AlignPosition & AlignOrientation to do so. Though I can’t disable the collision of the pet or it will kick the player like a boot.

ㅤㅤㅤ

⁝ Script & Locations

Here’s my script:

function removeCurrentPet(Player) -- Arguement is the selected player
	local PetList = game.ReplicatedStorage.Pets:GetChildren() -- List of all pets that exist
	for _,pet in pairs(PetList) do -- Goes through the PetList
		for index, part in pairs(Player.Character:GetChildren()) do -- Goes through players character
			if part:IsA("Model") then if part.Name == pet.Name then part:Destroy() end end -- If it finds pet it destroys it
		end
	end
end

workspace.BluePart.ClickDetector.MouseClick:Connect(function(Player) -- When a clickdetector is pressed
	removeCurrentPet(Player) -- Removes any existing pet
	
	local char = Player.Character -- Gets character
	local Pet = game.ReplicatedStorage.Pets.BlueBlock:Clone() -- Clones chosen pet
	Pet.Parent = char -- Places pet in character
	Pet:SetPrimaryPartCFrame(char.HumanoidRootPart.CFrame) -- Positions pet to the HumanoidRootPart
	
	local PetAttachment = Pet.HitBox.PetAttachment -- Finds pet attachment (Attachment0)
	
	local TorsoAttachment = Instance.new("Attachment") -- Creates torso attachment (Attachment1)
	TorsoAttachment.Parent = char.HumanoidRootPart -- Places attachment in HumanoidRootPart
	TorsoAttachment.Position = Vector3.new(2,4,2) -- Positions attachment
	TorsoAttachment.Name = "TorsoAttachment" -- Names the attachment

	local AlignPosition = Pet.HitBox.AlignPosition -- Finds AlignPosition of pet
	AlignPosition.Attachment1 = TorsoAttachment -- Sets Attachment1 to TorsoAttachment
	
	local AlignOrientation = Pet.HitBox.AlignOrientation -- Finds AlignOrientation of pet
	AlignOrientation.Attachment1 = TorsoAttachment -- Sets Attachment1 to TorsoAttachment
end)

ㅤㅤ

:black_small_square: The Script from above

PetHandler

ㅤㅤ

:black_small_square: The Pet Locations

Pets

ㅤㅤ

:black_small_square: The ClickDetector Locations

Clickdetector

ㅤㅤㅤ

⁝ Thinkable Solutions

[•] To disable pet collision for every player through client-sided scripts.
[•] Find a better way to make a floating system.
[•] Use while loops for the same result. (Last Resort)

ㅤㅤ

:heart: Thank you for the assist! :heart:

ㅤㅤㅤ

⁝ Solution by @gertkeno :heavy_check_mark:

▣ Question: How do you fix this?

► Answer: By disabling massless, you are making it unable to use gravity!

Lovely post! Could you go into more detail why you cannot disable collision for pets? “kick the player like a boot” are you saying the animation of it walking looks bad?

When you disable collision server-sided, the part flings the player and then floats down to the void eventually destroying itself.

⁝ Edit

There is no animation or anything added, I showed you everything that’s inside the script of the pet.

Hmm AlignPosition and Orientation shouldn’t apply any force on Attachment1, unless you have ReactionForceEnabled ticked true. Maybe setting pets to Massless, they shouldn’t really be calculating as a part of the character’s body

1 Like

Thank you so much!
I never thought of using massless you’re so bright-minded!

1 Like