
2. Aim Trainer
Using Unreal Blueprints, this is a Aim Trainer in which upgrades can be bought through a shop of Cosmetic and Weapon upgrades.
My aim for this project is to produce a customisable 3D aim trainer, in which the player shoots targets that spawn randomly around them and gains points for each target hit. These points can be used to customise the environment and targets by changing their materials/colours. Being able to use what I have learnt in my first year, I found that this artefact would work well, as I am able to use a random spawner using classes and arrays, with also using what I have learnt with changing colours of actors spawned from an array.

^ Snippet of code that shows how orbs, special x5 point cubes and -5 bombs spawn in the list of Target Points.
Today (17/03/2023) I worked on mainly on a difficulty manager, in which you can press E on an object to increase or decrease spawning rate of the targets. With this I found that I needed more target spawns, so I added 50 total spawn points for the spheres to spawn. I had issues with casting and referencing other scripts but after some research I learnt when and how to use casting in order to get variables from other scripts. One issue I did have is running a cast for every tick on delta time, which is very costly on the game’s performance, and to fix this I should run a custom event every time the difficulty is changed using event managers.
(06/04/2023) Fixed up the difficulty manager, making a max of 10 levels and at level 0 the orbs stop spawning. I also added a Store in which you can use your points to buy, so far, colour customisation that changes the colour of the orbs. Also, an option for rainbow, which spawns each orb with a random colour.

^ Snippet of code that describes pressing E and Q to increase and decrease difficulty.
Added a special class of cubes that spawn 1/20 times that give x5 points, all done in the same script.
I had lots of issues with integrating the cube to do a check between whether the bullet is colliding with the sphere or the cube but found to convert the “Other Actor” output from the event, and get its class then compare it to the BP_Special class, then adding a new variable to control how many points are added. I found this area tough but I’m proud that I eventually got it working after lots of experiments and no google searches. I specifically am proud that I managed to create a functional store UI and clickable buttons with no external help. I really feel like I am progressing fast now.
Adding a sandbox type store was something I felt would take the game to another level. I wanted the player to use the points gained to upgrade the weapon and customise the experience. So, to start with was colour changing the balls. I used what I learnt in the workshops to change the colour of the spawning orbs and made a rainbow unlock which each one had a random RGBA material assigned to it. Also changing the weapon shoot speed and size of the balls. I felt these where really fun, and I had found myself just playing my game and actually enjoying it – personally liking sandbox type games and also aim trainers. I did have lots of issues with collision, but after trial and error and assigning appropriate collision types to each object in the scene managed to get it working.
The sensitivity is a major thing in aim trainers, so inside the difficulty manager, (in which I changed to be called a settings manager) I added a sensitivity slider and displayed the dpi so the player can have their preferred sensitivity. I had lots of issues with getting a reference to the mouse sensitivity inside the player controller but learning that I can use “Context Sensitive’ I can find variables and events that aren’t actually available to me unless I cast them from the appropriate actor/class.