如何检查对象是否在CurrentCamera Lua中



所以我在代码中为一个对象定义了一个变量,我想检查它是否在当前玩家的相机中。有人能提出建议吗?谢谢

这样就可以了。请下次回答时包括您当前的代码,这样我们可以帮助您更好地理解!

local Object = GetObject -- Place the object's path under a variable.
if Object.Parent == workspace.Camera then -- Right now, we're getting the Object's part and then comparing it to workspace.Camera. If this comes back as true, the function runs. If not, it won't run.
-- Do something
end

最新更新