Why does my simple function cause this error?

Why is it saying Position is not a valid member of this model when it is?


image
Sorry if I’m overlooking something obvious, any and all help would be appreciated :sweat_smile:

1 Like

As I See The Class Name Of The Object Is Model
You Could Remove Position And Orientation And Place It With This
clone:PivotTo(Part.CFrame)

2 Likes

Does your tree has multiple parts in it?

1 Like

It Doesnt Matter How Many Parts Are We Usually Use PivotTo() To Set A Position And Orientation Of A Model

1 Like

If you want to obtain the position of a model, you have to make sure that the model has a PrimaryPart. This part will be the ‘anchor’ of the model which can be used to get in this case - the CFrame Position.

Double check by doing the following; (this is just an example)

local model = game.Workspace["Classic House"] --//Obtain model
model.PrimaryPart = model.House["Smooth Block Model"] --//Part to set as primary

print(model.PrimaryPart.Orientation) --//This will output the screenshot below

image

1 Like
Part = script.Parent

script.Parent.Parent.ChildRemoved:Connect(function()

local clone = game.ReplicatedStorage.Plants.Tree:Clone()
wait(5)

clone.Parent = script.Parent.Parent
clone:PivotTo(Part.CFrame)
1 Like

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