Hey, Guys 😀
I’m having a little trouble with my Top Down 2D game. I would like my player to shoot a RayCast2D in the direction he is facing, but creating the directional vector is causing an issue. The Ray does not shoot in the correct direction. Here is my script:
firePoint = transform.Find("FirePoint");
Quaternion rotation = PlayerController.playerRotation;
Vector3 direction = rotation * Vector3.forward;
RaycastHit2D hit = Physics2D.Raycast(firePoint.position, direction, 100);
The vector “direction” is always in a funny place and not in front of my player as it should be.
Any help is appreciated. Thanks so much! 🙂