I tried to make projectile for a Spaceship for 3D game. But whenever I instanitate an projectile and make it move, ıt falls . I assume because of rigidbody but couldn’t find how to fix. I want projectile to move forward and not fall.
Those are components of projectile
Those are codes I used to keep projectile from falling.
public class Projectile : MonoBehaviour
{
void Update()
{
//transform.position += new Vector3(-1, 0, 0) * 0.1f;
//GetComponent<Rigidbody>().velocity = -transform.right * 100 * Time.deltaTime;
//GetComponent<Rigidbody>().AddForce(transform.up * 0.000001f);
}
}