- Home /
This question was
closed Apr 23, 2018 at 08:06 PM by
Fibonacci_0_1_1 for the following reason:
The question is answered, right answer was accepted
Question by
Fibonacci_0_1_1 · Apr 23, 2018 at 05:57 PM ·
rotationraycastshootingraycastingforward
raycast is pointing in two directions?
My raycast is pointing in two directions. one direction is the direction i actually want it to point the other direction is the same as the other, except it doesn't rotate on the Z axis.
how can i solve this issue? here's the code I'm using. My bullet is a child of my weapon.
RaycastHit hv;
if (Physics.Raycast(bullet.transform.position,bullet.transform.forward,out hv, range))
{
Debug.Log("weapon hit");
}
untitled.png
(9.8 kB)
Comment
Best Answer
Answer by Fibonacci_0_1_1 · Apr 23, 2018 at 08:06 PM
FIXED IT. I simply ran my code within FixedUpdate.