I want to make the camera in "DriveScriptAWD"(Local) to locate
Car chassis is the parent of "Parts" and "DriverSeat"
"Parts" is the Parent of "CamFocus". "DriverSeat" is the Parent of "ToolGiver"
"ToolGiver" is the Parent of "DriveGui"
"DriveGUI" is the parent of "DriveScriptAWD"
I can't figure out how to locate "CamFocus" locally.
My script:
cam.CameraSubject = ???
How can I do this?
If I understand you correctly, your Instance hierarchy is as follows:
--Car Chassis ------Parts ----------CamFocus ------DriverSeat ----------ToolGiver --------------DriveGUI ------------------DriveScriptAWD
So:
cam.CameraSubject = script.Parent.Parent.Parent.Parent.Parts.CamFocus
But it would be better to make references to them so that it's easier to see what is going on:
driveGUI = script.Parent toolGiver = driveGui.Parent driverSeat = toolGiver.Parent chassis = driverSeat.Parent parts = chassis.Parts focus = parts.CamFocus cam.CameraSubject = focus
I hope that answers your question.