What’s the best way to tell if userdata is Vector3 or a Model Instance?
function example(ModelOrPos)
if isModel(ModelOrPos) then
ModelOrPos = ModelOrPos.PrimaryPart.Position
end
-- Do stuff with the Vector3
end
It seems to error if you do something like
function example(ModelOrPos)
if ModelOrPos.PrimaryPart then
ModelOrPos = ModelOrPos.PrimaryPart.Position
end
-- Do stuff with the Vector3
end
Is there a good way to do this without having to resort to pcalls?