Monday, 12 February 2018

Week 20

Week 20:

HND Project

Alrighty, I’ve now got the essentials down for an okay game. This week I’m going to be focusing on creating a “Spawn” system to implement into our UE4 Project. To begin with, I had to create a new “Actor” blueprint class and then named it “EnemySpawner”. Once I had done that, I then clicked on it and in the “Viewport” I created a “BoxCollision” I simply named “SpawnVolume”.



Then, I used to the “Spawn Volume” variable to create the following code as seen below. This part of the coding allows the Zombie AI to be spawn randomly and anywhere on the Map. After this, I went into the “GameMode”. There, I created a “EventBeginPlay” and began to create the following code. Basically, this code allows the Zombie AI to be spawn as soon as the Game begins. 




After this, I brought the “EnemySpawner” box onto the Map, before I re-adjusted its length and width to match that of the Map. After that, I pressed play only for… Nothing to happen. This reason for this is because I forgot to set one of the values for the “EnemyPerSecond” variable. Because it was set to “0” that meant no Zombie AI would appear on the screen. I corrected this to the right value I needed (1).

I then tested it again and…

Ta-Da…!!





No comments:

Post a Comment