I am trying to set a Model’s parent to a Part located in the workspace.
I set the parent of the Part to the Model without any errors, but if I check the explorer the Model is clearly not parented to the Part.
I am using this code:
model.Parent = part
print(model.Parent.Name) --This prints the part's name, as if the part is the parent.
--But after checking in the explorer, the model isn't inside the part.
I have tried looking on the devforum and other places for a solution to this, but none of them have helped me. Thank you for any help!
you need to set the primary part of the model’s CFrame as well.
For example, if you wanted to move a player you set their HumanoidRootPart and the rest of the player follows.
I’ll provide an example but keep in mind this example will only work if you set the model’s primary part in the explorer of the model.
model.Parent = part
model.PrimaryPart.CFrame = part.CFrame
yeah good idea, but I tried parenting the model to the workspace and it works fine, but putting it inside the part just makes it disappear. (As I said before I tried printing the parent of the model and it says it is the part, but it’s clearly not)
I have tried alternatives, but for what I am working on I need to parent the model to the part. You can do this in studio regularly, but with the script I used it doesn’t seem to be working.