top of page
Search

Player Hit!

  • Abbie Hipwell
  • Apr 1, 2022
  • 2 min read

Updated: Jun 14, 2022


Whilst we were testing the game and playing it between the group, we noticed that it is very hard to see when the enemy has been hit, especially if they are far away - although the barrier moving is an indication of this, it would be nice to have some sort of effect which shows the impact of the projectile on the player, making our game more believable. Effects are not only good at indicating a player has been hit, but they create a more enjoyable experience for players, particularly the younger demographic. By creating effects which are stylised or cartoon-like, we cater to this audience and enforce the 'fun' and 'competitive' themes of our game.


Myself, James, and Jade worked on these, with James working on creating the VFX in Unreal and various software. Both Jade and I came up with the idea of a camera shake combined with a launch effect, which simulates the impact of the player being struck by a projectile.


There is already a function in Unreal called 'world camera shake' which allowed us to do this, this made the mechanic a lot easier instantly. From here we simply plugged in the 'get actor location' node into the epicentre, this means that the camera shake would only effect players within this area. The camera shake at first was very sudden and a bit too much for our game, however if we changed the values of 'outer radius' and 'falloff', we were able to achieve a better result.


We combined the camera shake alongside the 'launch character' function; this works by suddenly launching the player forwards depending on what the velocity is set to. To launch the player backwards as if they were being hit by the projectile, we simply set the value of launch velocity to -1000, adding the negative onto the launch velocity value will move the player backwards instead of forwards (as it is flipping the forward vector).


The code for this can be seen below:


The camera shake function was then implemented into the Death and Respawn code, meaning that if a player was hit with the ball, the code would run this function for that player.


I created a function for the camera shake and launch, this was mostly due to preventing it from cluttering the blueprints; it also meant that this could be easily referenced at any point.


We implemented this function into the 'Death and Respawn' blueprint, this resulted in the player who had been hit, being launched backwards and initiating a camera shake around them.



To activate the VFX that James created, we simply added an 'activate' node, which runs when the player is hit, just like the camera shake. Each effect is then connected to the target of this.


Working with James and Jade on the effects was beneficial as we were able to get a lot implemented into the game within a short amount of time, and create something which would be extremely beneficial to the players.

 
 
 

Комментарии


bottom of page