O'Reilly logo

Unity 3 Game Development HOTSHOT by Jate Wittayabundit

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Game over-Wrapping it up

In this chapter, we have optimized the AIController.js by changing from the Physics.CapsuleCast to 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 Instatiate() and 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 rocket script.

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 (TriggerArea).

So, let's take a look ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required