on-internet
← Community

Why does my Unity projectile code cause it to move backward instead of where my camera aims?

Stack Overflow ·

I have a projectile attack I've given to the player in a Unity 6.6 game I'm working on. The projectile is meant to fire in whatever direction the player's camera is looking, but whenever I try to shoot it straight forward the bullet instead flies backward and upward. It seems like shooting any further up or down works just fine though, only when firing straight forward does this happen. What might be causing this issue, and how I can fix it? Here's the script I used for the projectile prefab: using UnityEngine; [RequireComponent(typeof(Rigidbody), typeof(Collider))] public class Projectile3D :

Comments

Sign in or sign up to comment and upvote.

No comments yet.