Putting recoil along the rotated axis

Hello Devs,

I am totally new to UE, like extremely new so I need a help.

I want my object, which is a gun, move back on -x axis upon shooting. Now I can rotate my object using Left and Right Arrow key. After rotating, the gun doesn’t travel on rotated x axis but on initial x axis. So please help me on this! Thanks!

Reference video and blueprints are there in the link:

New User so can’t attach video or image.

Hey L0neLY7,

Welcome to the forum!

In order to do what you want you’ll have to extend this part of your blueprint:

Here instead of directly adding impulse (-100.0, 0.0, 0.0) you should add it relative to the gun. The simplest way is to get its forward vector and to multiply it by -100 (which will make it point back) like so:

1 Like

dZh0, thanks for responding to this. I am late to reply cause I have been trying to implement your idea but it seems like I am catching myself in lot of complexities like differences in Scene Component nodes, Actor nodes, etc etc. I will try to find a way and if not then I will get back to this forum for help. PS: your help really means a lot, thank you!