How do I reference children of an object value?

For example i have an object value and its value is a model, i want to get a part in the model called target, How would I do that

Objectvalue.Value:FindFirstChild("Target") 

doesn’t seem to work.


local objectValue = Instance.new("ObjectValue")

objectValue.Name = "MyBaseplateReference"

objectValue.Value = workspace:FindFirstChild("Baseplate")

objectValue.Parent = workspace

If the value of ObjectValue = (example) workspace.Part then workspace.Part = ObjectValue.Value

1 Like

Do you get any errors?
You need to make sure Objectvalue.Value is holding the correct model and not just nil.
Also, make sure the part called ‘Target’ is directly under the model. If it is more deep in the hierarchy then you need to add , true to the FindFirstChild to make sure it checks the entire tree of descendants

Objectvalue.Value:FindFirstChild("Target",true) 
4 Likes