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)```