In this chapter, we have optimized the
AIController.js by changing from the
Physics.Raycast to increase the FPS in our game. Then, we learned how to create the ragdoll object and apply it to the character when it is dead by using
Destroy() functions to clone the ragdoll prefab and replace the old object.
Then, we created the destructible
Wall and destroyed it when we shot at it by adding some script to the
We also created the
Rockslide game object, the
Rocks script to enable and disable
rigidbody of the rocks, and the
triggerArea game object to make the object fall down when the player hits the
triggerArea by using another script (
So, let's take a look ...