我尝试用“WaitForChild”来索引 nil我的塔防游戏出错

发布于 2025-01-14 23:26:40 字数 209 浏览 3 评论 0原文

我正在制作一款塔防游戏,刚刚在我的健康脚本中出现 attempt to index nil with 'WaitForChild' 错误。塔正在看着敌人,播放动画,它只是不显示僵尸的更新健康状况。有问题的假设代码是 local humanoid = model:WaitForChild("Humanoid") 有人知道如何让它显示更新的健康状况吗?

I am making a tower defense game and just got attempt to index nil with 'WaitForChild' error in my health script. The tower is looking at the enemy, playing the animations, it just does not show the updated health of the zombies. The supposed code in question is local humanoid = model:WaitForChild("Humanoid") Does anybody know how to make it show updated health?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

dawn曙光 2025-01-21 23:26:40

model 为零。确保设置正确。

model is nil. Make sure you set it properly.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文