top of page
Search

Dev Log#18: Making A Rocket Launcher!!!

The rocket launcher is a projectile weapon however we don't want it to behaviour the same way as an assault rifle. The projectile weapon class works fine, its the projectile itself that needs to be unique for the rocket launcher.


So in my projectile class I created a function for explosion damage which uses the apply radial damage function as the rocket should be able to damage multiple players depending on how close they are to the rocket.


I also created a spawn projectile trail function for spawning my VFX that I made using Niagara in the editor. The reason for implementing these functions in the parent projectile class is because these functions will also be used for my grenade launcher functionality.


In the rocket projectile class I'm calling these functions in begin play for spawning the VFX and in destroyed for applying the damage. A unique thing I'm doing is spawning in a sound cue and attaching it to the rocket so when the rocket is travelling players will be able to hear it whizz over their heads or towards them. Which from a game design aspect will serve as a big indicator to players that they're in serious danger.


A problem I encountered is that the rocket projectile collides with the player instantly at times resulting in instantaneous combustion and death. It happens so early that even if I had the character onto the list of actors to ignore this bug still occurs.


The issue is that the projectile movement component class in unreal engines code by default handles the impact by setting the blocking hit's state to deflect, which assumes that there's been a change in velocity. In my scenario what I need to do is create my own projectile movement component and set the blocking hit state to advance next sub step which is where hit logic can be ignored and movement can continue. The handle impact function is overridden as well in the rocket movement comp because we want it to do nothing the collision box is what will be determining the hits for the projectile.

 
 
 

Comments


bottom of page