Question by
TheLastVoidMage · Mar 28, 2019 at 06:20 AM ·
rotationraycasttroubleshooting
Raycast Trouble
I am trying to fire in the direction where my player is facing but something is going wrong. When I try to fire, it only fires down when I'm looking right and up when I'm facing left. I am kinda new to this and I think I kinda understand what's going on but I don't know how to fix it. Here is my code.
if (Input.GetMouseButtonDown(0))
{
RaycastHit2D hit = Physics2D.Raycast(transform.position, Vector2.one * this.transform.rotation.z, 100);
DidHit = hit;
}
Comment
Your answer
Follow this Question
Related Questions
[Solved]Raycast Direction Wrong 1 Answer
Making a portal inspired game - Need help! 0 Answers
Raycast issues while rotating a GameObject 1 Answer