Wednesday, June 17, 2015

[Unity 3D] Tutorial 3: Survival Shooter

This is a top down isometric style game in which you basically need to shoot everything that moves to survive (a.k.a. survival shooter). You impersonate a boy who's dreaming that all of his toys have come to life. This is the last beginner level tutorial and covers the following topics:

  • Use layers to isolate game objects
  • Animations: use and control transitions in model animations, animate GUI objects
  • Ray casting
  • Input.GetAxis vs Input.GetAxisRaw
  • Movement normalization
  • Time.deltaTime
  • Use Lerp to smoothen transitions
  • AI: use NavMesh, bake a navigable area
  • More on GUI components (CanvasGroup, Slider, Image, etc.)
  • Awake method
  • LineRenderer
  • Alternative method for timers: InvokeRepeating

These are the main modifications I made to make it work in Unity 5:

  • Disable the flag "Has Exit Time" so the animations are in sync with the events. This cancels the ongoing animation when there is a transition to another state
    • Open the Animator Controller
    • In the Animator window, select the transition to modify
    • In the Inspector, locate and uncheck the flag
  • Change the LineRenderMaterial to use an Unlit/Color Shader. The LineRenderer renders the lines black under certain shaders.

The export to WebGL in this project is not so good. The scene appears very dark and the textures have some kind of black spots, but it should look like on the image below. I believe this is because of the preview version of the WebGL player, or maybe due to incompatibility of the assets with Unity 5. Anyway the game is playable, so give it a try and let's see how much you can last!


No comments:

Post a Comment