昨天写的文章应该是丢失了
有一点伤心,不过应该没什么问题。
那我们就进行今天的写作。
Now Ruby gets damage all the time, and maybe too much! She’s getting to 0 health in a fraction of a second (well, in exactly the numbers of frames equal to her health). And you may also have noticed that we don’t get any messages on the Console when we stop moving Ruby around, so she’s not getting damaged when she stands sill.
To fix the last problem, we need to open our character prefab and in the Rigidbody,
set the Sleeping Mode to Never Sleep:
这里遇到一个新的知识点。当任务站在破坏区域的时候,一直扣血,但是如果生命值到了0,他不会在扣血。然后解决这个问题是将人物的SleepingMode改成了NeverSleep.
原因如下:
To optimize resources, the physics system stops computing collision for a Rigidbody when it stops moving; the Rigidbody “sleeps”.
原来的模式,会导致刚体睡眠,也就是不会对我们的伤害进行反应,当我们设置他会用不休眠的时候,就会进行正常的扣血了。
其他没有没有什么新内容了。都是学过的。