【问题标题】:How do you anchor tons of groups with a script in Roblox?您如何在 Roblox 中使用脚本锚定大量群组?
【发布时间】:2020-06-21 15:42:27
【问题描述】:

我已经为一张在许多松树中生成的新地图工作了很长时间。在我完成所有工作之后,我注意到松树中的对象没有锚定我在里面制作了一组名为“PineTrees”的所有松树我放了一个普通脚本来尝试锚定组中的所有对象。它最终抛出错误“GetDescendant 不是模型的有效成员”。这是脚本:

local model = script.Parent
local childs = model:GetDescendant() 
for I,v in pairs(childs) do 
    if v:IsA("BasePart") then 
        v.Anchored = true
    end
end

【问题讨论】:

    标签: lua roblox


    【解决方案1】:

    你只是拼错了function's name

    local childs = model:GetDescendants()
    

    【讨论】:

      猜你喜欢
      • 2022-08-06
      • 2022-09-25
      • 2021-12-03
      • 2011-05-14
      • 2022-11-02
      • 1970-01-01
      • 2019-02-28
      • 2021-08-25
      • 2022-09-27
      相关资源
      最近更新 更多