Yes, and for my own understanding, Vector3.forward alone will not achieve diagonal movement, is this right? Either the transform in this case is forward facing the bullet’s target, or Vector3.forward should be replaced with a diagonal vector.
But don’t you want to shoot in whatever direction your avatar is facing? The code above would ensure that, as his local forward vector would be made into a world vector by the TransformDirection function. The resulting vector of transform.TransformDirection(Vector3.forward) is diagonal, if your avatar is facing diagonally.
If you want him to shoot diagonally, even if he’s facing up, that’s a different scenario than what I expected.
I believe the scenario is that the player faces left and right, so only shoots left and right. In order for transform.TransformDirection(Vector3.forward) or even transform.forward to work diagonally, a script to aim diagonally would have to be written.
You may be right, I have no idea anymore It doesn’t change the fact, to shoot diagonally by some force, you can’t put that force on two components of the vector. That will make the vector.magnitude be sqrt(2) too long.