i'm making the bullet for a third person shooter game. i'm using a rigidbody3d. i got it to shoot correctly by setting the position and transform to that of a raycast on the gun model. the issue is, the x axis is flipped. two of the axes work fine, i can aim vertically and i can shoot directly in front of me or behind me. but when i turn 30deg to the right, the bullet goes 30deg to the left. when i turn all the way to the right or left, the bullet goes backwards into me. is there a way to flip just one axis around?
note that the rotation is applied correctly, the physical model for the bullet always faces in the right direction. i just want it to move in the direction it's facing.
(i gave up on trying to get coordinate letters right, godot's incorrect coordinate system makes it really confusing. thinking of switching engines because of this)
player script-
bullet_instance = bullet.instantiate()
bullet_instance.position = gun_barrel.global_position
bullet_instance.transform.basis = gun_barrel.global_transform.basis
get_tree().root.add_child(bullet_instance)```
bullet script-
```func _ready():
gravity_scale = 0.3
apply_impulse(Vector3(0, 0, -40) * transform.basis)```