function GetObject(fullName)
--get a object with the parameter, fullName
end
local camFullName = workspace.Camera:GetFullName()
print(GetObject(camFullName)) --> workspace.Camera
--OF COURSE THERE AREN'T OBJECTS THAT HAVE SAME NAME.--
I presume you’re trying to get an instnace from a string, you can use something like this for the code in GetObject
function GetObject(fullName)
local segments = fullName:split(".")
local current = game
for _,location in pairs(segments) do
current = current[location]
end
return current
end
Took it from here and changed it up a bit
Basically it splits the full name from the dots, and then uses those splits as a way to navigate through the directory stating from game and ending up at the location needed