Transform.forward changes by double the amount of rotation?

I have an object that with the following code:

[SerializeField] private float speed = 10f;
public bool go;

void Update()
{
    if (rb.velocity.magnitude < .2f && go)
    {
        rb.AddRelativeForce(speed * Time.deltaTime * transform.forward);
    }

    if (!go)
    {
        rb.velocity = Vector3.zero;
    }
   
}

With no other input, transform.forward move the object positively in the z-axis, but if I rotate the object in the inspector to Y:90, the movement does a 180 and starts going negatively in the z-axis. If I do Y:45 it moves positive X. Same thing with X-axis rotation, X:90 goes backwards, X:45 goes negative Y.

Am I missing something? Why does transform.forward change by 2x the rotation I give the object?

I think you’re mixing coordinate systems.

Transform.forward is in World Space, and AddRelativeForce is local space.

So you either want to use AddForce with transform.forward, or AddRelativeForce with Vector3.forward

Just pointing that out made me realize why that was wrong. Thanks. Using AddForce with transform.forward has fixed it.