Instagib/ Rocket Jump advice for first game?

Heyo All,

How would I make make an instagib laser/rocket jump in the same format? Do I need to create a line trace, then add impulse to it, or do people tend to make a projectile, and then make that projectile go really fast? I am trying to make my first simple game and would really appreciate help.

Many Thanks,
Chalm

Do you want instant hit or not ?
If yes, use line trace.
Othewise, use projectile.

Adding impulse is done in the way you deal with the impact. It doesn’t matter whether you used hitscan (line trace) or projectile.

Upon impact you can “Apply Point Damage” to whatever you hit, with a high damage value, to ensure kill.

Simultaneously you can also “Apply Radial Damage” with 0 damage, to generate a splash radius for propelling players (rocket jump).

Alternatively if you only want to propel the instigator (ie. not make enemies bounce around when you shoot at their feet) you can simply check the distance between fire start and impact, and apply a reverse impulse to the firing player.

Thanks a bunch for responding. I’m looking for an instant hit and a rocket jump in one laser beam. So if I were to hit an enemy they would die, but if I were to shoot a wall or the ground, then I would be launched from that direction.

when the line trace hits something, you get a hit result struct. Break that struct and you can get what sort of actor was hit, among other data.

if an actor is hit, you can call an event on that actor so taht they can respond however they want.

you can set the default case - i.e. no actor was hit - to have the impulse at the hit location.

you can add tags to different actor types, which makes it so that you could poll for many types of actors and not be class dependent. You would just get the hit actor and get tags. that gives you an array you can loop through to check for specific tags taht you are interested in.

So I just got way more confused when trying this. I am trying to make a system where it would also be able to launch the character horizontally if I shoot the wall. How would I go by doing this? Sorry. I am very new to this and thought it was going to be simple.

Hey @Chalm16162 !

For the explosion you need something like this

For this, I’m using what @BIGTIMEMASTER suggested, that is to use the HitResult, more importantly, the Impact Normal, which is a vector opposite of the hit on the surface (more info here), then I check if the Hit was near the player or the source of the raycast/line trace. And finally, if it meets the criteria, I add an Impulse of an absurdly large value (you can tune it up as you want).

For that, you have to cast the hitActor to whatever class you are using for the enemies. Something like this:

P.S: For this example I used these values:

image

1 Like

Heyo,

I’ll give this a go now. <3 Thank you so much for your help!