Having
a working HUD is nice seeing the health bar move when taking damage and putting
in multiple hits to enemies before they fall to the ground lifeless being
shoved out the way by the rest of the horde of cube bots and having the cube
bots find the shortest way around objects towards the player and having the
small effects of light flashes going off when shooting at them is enjoyable and
would certainly add to the experience if it was polished. Unfortunately, there’s
problems with the camera positioning which in future versions or attempts I
would like to fix so that it is no longer so close to the character and large
that it clips through the bottom of the environment and the player but should
be achievable with a few minor tweaks in the unity editor with the positioning.
I would also like to add sound effects to the game in future such as background
music and gun sounds when shooting maybe even some sounds when taking damage
and on death would possible. Of course, I would like to use proper models with
textures in future attempts.
Now to create a game controller start by making a new game object and name it Game Controller and set it to origin position and change the tag to Game Controller and add component, new script and name it game controller, now edit the game controller script. Public class GameController : MonoBehaviour { Public GameObject hazard; Public Vector3 spawnValues; Public inthazardCount; Public float spawnWait; Public float startWait; Void start () { StartCoroutine (SpawnWaves ()); } IEnumerator SpawnWaves () { Yield return new WaitForSeconds (startWait); while (true) { For (int I = 0; i < hazardCount; i++) { Vector3 spawnPosition = new vector3 (Random.Range (-spawnValues.x, spawnValues.x), spawnValues.y, spawnValues.z); Quaternion spawnRotation = Quaternion.identity; Instantiate (hazard, spawnPosition. spawnRotation); Yield return new WaitForSeconds (spawnWait); } Yield return new WaitForSeconds (waveWait); } } } Select the Game Contr...
Comments
Post a Comment