Keeping weapon aligned and bullets restricted on the X

Shizane

New member
I've been playing with the settings in the ShootableWeapon script on my weapon item to fix 2 things:

My project is a Pseudo 3D restricting the players on the X.

1. I can't seem to get the gun to stay aligned with the X after it shoots, it wants to rotate after it shoots but then snaps back to aligning with the X again. It looks weird. Is this just the animation? I set the recoils to 0 and Fire in Look Direction on.

2. With a bullet projectile, how do you set the projectile to just go straight when you shoot instead of sloping down AND how can you restrict the bullet on the X? Perhaps in a Rigidbody restrict? I tried playing with the Magnitude and Fire in Look Direction on.

The bullets sometimes don't hit the enemy so I'm trying to tweak this to ensure the bullet doesn't stray...
 
1. Sorry I don't fully understand what you're asking here - you have the character's X position restricted, but want the gun to rotate freely? Maybe a gif or something would help me understand what you mean

2. On the Projectile component, you can set various physics parameters including gravity magnitude.
 
Top