- Home /
How to make a shotgun boost effect?
I am currently working on a game, and I have guns already added and everything. There is just one component I want to add, but don't know how. I want to make the shotgun so you can point in any direction, and when you jump(which I have this part covered), you get blasted in the opposite direction that you shot. I looked on YouTube for 2 days now and have no luck. If someone could help me out that would be great. Thanks! - Vance
This is what I have
if (readyToShoot && shooting && !reloading && bulletsLeft > 0)
{
bulletsShot = bulletsPerTap;
Shoot();
if (boostable && isGrounded == false)
{
player.GetComponent<Rigidbody>().AddForce(, ForceMode.Impulse);
}
}
I don't know what to add in the AddForce() function to make me go in the opposite way I am looking
Answer by unity_zgZIxccP2cRekQ · Mar 16, 2021 at 03:24 AM
If anyone has answers for me, please make sure to @ me! Thanks
Answer by AbandonedCrypt · Mar 16, 2021 at 08:25 AM
just multiply the direction you're looking at with -1, then multiply that with your desired force amount
Your answer
![](https://koobas.hobune.stream/wayback/20220613030747im_/https://answers.unity.com/themes/thub/images/avi.jpg)