Hi everyone,
I have a topdown view in my game, for that I rotated my cam 90° around the X axis.
Now I have a “shooting” script.
GameObject projectile = (GameObject)Instantiate(Resources.Load("projectile"),spawn.position,Quaternion.identity);
projectile.transform.LookAt(cursor);
projectile.rigidbody.AddForce(transform.forward* bulletSpeed * Time.deltaTime);
Destroy(projectile,5f);
The Problem is, my projectile is not moving to my desired direction “forward” its moving to the north, but my “gun” is facing to the right.
I think that is because of my camera rotating right? So how do I recalculate the direction ?
I also tried TransformDirection and so much more nothing works for me:/
THanks in advance