Help with projectile

Hi
So i got a particle that i would like to shoot out from a gun problem is it only moves on 1 axis no matter where i am facing. Any help?

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class ProjectileMove : MonoBehaviour
{
   
    public float moveSpeed;
    public float fireRate;
    // Start is called before the first frame update
    void Start()
    {
       
    }

    // Update is called once per frame
    void Update()
    {
        if(moveSpeed != 0)
        {
           transform.position += transform.forward * (moveSpeed * Time.deltaTime);
        }
    }
}

Nvm i figured it out

EDIT: glad you figured it out. sorry i hit post before refreshing.

Is this in 2d or 3d? I can explain what I did in 2d if that will help to get the projectile to shoot elsewhere. but I’m not very familiar with 3d.

either way, no matter which it is, what you will want is a Vector (either vector 2 or vector 3 depending on how many dimensions you are using) right now you have the transform.position which is a vector 3. added to that you have the transform.forward, which is also a vector 3. so that part looks fine (to me).

However, you are also multiplying it by move speed, which is not a vector, but a float. I’m guessing that’s where your error is.