Help making different models face the same direction

Hello everyone,

I’m making a sort of baggage trolley system where the player equips a suitcase tool and the tool is placed onto the trolley. However, what I am having trouble with is getting any kind of suitcase model to look the same on the trolley. Each model has a different orientation when placed on the trolley, but I need them all to lie flat and face up. How would I achieve this?

For example, suitcase 1:

image

Versus suitcase 2:

image

Part of the script that does this:

-- tab is a table with acceptable suitcase names
-- model.bag is the part where the suitcase should go

char.ChildAdded:Connect(function(c)
		if table.find(tab, c.Name) and c:IsA("Tool") then			
			for i, v in pairs(c:GetChildren()) do
				if v:IsA("BasePart") or v:IsA("MeshPart") then
					v.CanCollide = false
				end
			end
			
			c.Parent = model
			
			c:MoveTo(model.bag.Position)
			c.PrimaryPart.Orientation = model.bag.Orientation
			
			local weld = Instance.new("WeldConstraint")

			weld.Part0 = c.PrimaryPart
			weld.Part1 = model.bag

			weld.Parent = model.bag
			
			c.PrimaryPart.CFrame *= CFrame.Angles(math.pi/2, 0, 0)
		end
	end)

In conclusion, I would just need to homogenize the orientation of the suitcases so they are all lying flat on the trolley. If anyone would know how to fix this, any help is appreciated!

Get the orientation of the bottom cage thing, then set the orientation of the suitcase to that orientation.

1 Like

replace :MoveTo with :PivotTo

1 Like

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