Model cframe and orientation doesn't work in world's settings

Hello fellow programmers,

I am trying to insert a model from the serverstorage to workspace after the clickdetector event is activated. The model’s position and orientation of the model should be properly in the world settings’ pivot’s position and orientation regardless of the part’s orientations and positions.

However, Model’s position and orientation keep mess up because the each clickable parts’ orientation and position are various, which requires more complex scripting that I am not there yet. I’ve included the video, here the link; how do I set Cframe and Orientation in the world setting through script? - YouTube if that will be helpful.

	local platform = eventPlatform:Clone()

			-- Set the platform's PrimaryPart
			platform.PrimaryPart = platform:FindFirstChildWhichIsA("BasePart")

			if platform.PrimaryPart then
				-- Set the platform's PrimaryPart CFrame to match the selected part
				platform:SetPrimaryPartCFrame(selectedPart.CFrame)

				-- Parent the platform to the workspace
				platform.Parent = game.Workspace
			else
				print("PrimaryPart not found in EventPlatform model!")
				platform:Destroy()
			end
		end)```
1 Like

Make sure all your Model PrimaryParts are aligned to the same Orientation.
Either that or I think you can use the PivotEditor to rotate and move the Pivot of the Primary Part.

The primary part is randomized with the part, but all parts’ pivot is at 0,0,0…it doesnt make sense because it supposed to be working like that way when you set pivot(world setting) to 0,0,0…

Disregard this question…

I’ve created more cframe lines to match necessary, its all good.

1 Like

Please mark your post as the Solution so others don’t keep trying to solve it.

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