MasonX890
(MasonX890)
1
Hello, I am trying to move a model, to the location of a different model, is this possible? If so, how would I do it?
local Booth = game.Workspace.Map.Booths:WaitForChild(Player.UserId)
local NewBooth = game.ReplicatedStorage.Booths.D:Clone()
NewBooth.Parent = game.Workspace.Map.Booths
NewBooth.Name = Player.UserId
I need to move NewBooth to Booths position on the map.
MasonX890
(MasonX890)
2
The Booth has multiple parts inside of the model, I don’t know if that would make it be a different script to move it.
Volieb
(Vinny)
3
First, set the PrimaryPart of the model to any part you find ‘worthy.’
Then, use model:SetPrimaryPartCFrame(cframe) which will move the entire model.
MasonX890
(MasonX890)
4
For the CFrame value, should i do Booth.PrimaryPartCFrame?
Volieb
(Vinny)
5
Yes. It may need some adjustment, but that is the gist of it.
MasonX890
(MasonX890)
6
When i do this, all it says is that PrimaryPartCFrame is not a valid member of the Booth
Volieb
(Vinny)
7
Try PrimaryPart.CFrame instead. My apologies.
1 Like
MasonX890
(MasonX890)
8
In the output i got attempt to index nil with ‘CFrame’
Volieb
(Vinny)
9
You need to set the PrimaryPart of the model to something, as it was not set to anything. You can do this via the properties menu.
1 Like
MasonX890
(MasonX890)
10
I did, i set it to a part called Primary, it covers the whole model
Volieb
(Vinny)
11
Ah. When you clone a model, the PrimaryPart does not carry over. In your script, set the model.PrimaryPart to model.Primary
1 Like
MasonX890
(MasonX890)
12
It works! I found my problem, I forgot to Anchor the parts
MasonX890
(MasonX890)
13
Thank you for all of your help!
Volieb
(Vinny)
14
No worries, glad you were able to figure it out. Make sure to mark the post as solved, you can mark your own replies.
1 Like