Model rotation problem

i genuinely have no idea how rotating works with models. i’m not even sure if models actually rotate in local space or world space but anyways.

im trying to pivot this brainrot on top of this plate with the correct orientation but this is the result i get with this code…

local Plate = workspace.Plate
		local plateOffset = CFrame.new(0, Plate.Size.X, 0)
		local plateCF = Plate.CFrame * plateOffset
		brainrotModel:PivotTo(plateCF)
		local modelPivot = brainrotModel:GetPivot()
		brainrotModel:PivotTo(brainrotModel.PrimaryPart.CFrame * CFrame.Angles(0, math.rad(90), 0))
		brainrotModel.Parent = workspace

with the model’s origin orientation property this would be the right orientation but idk how to achieve this.

i need to adjust the CFrame for like 10-20+ brainrot models too and i assume i should be saving the CFrame’s for each brainrot model for the plate in some sort of table and then look for that information later but im not too sure.

i appreciate any help thank u so much!

edit: im pretty sure the second PivotTo is the issue. not sure how to fix it tho.

got it. this did the trick.

		local Plate = workspace.Plate
		local PLATE_HEIGHT = Plate.Size.X

		-- CFrame.new(Plate.Position) extracts the position and sets rotation to (0, 0, 0)
		local plateOffset = Vector3.new(0, PLATE_HEIGHT / 2, 0)
		local targetCF = CFrame.new(Plate.Position + plateOffset)
		local desiredRotationCF = CFrame.Angles(0, math.rad(90), 0)
		local finalCF = targetCF * desiredRotationCF
		
		brainrotModel:PivotTo(finalCF)
		brainrotModel.Parent = workspace

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