#also show the Debug DrawLine or DrawRay
1 messages · Page 1 of 1 (latest)
how do we know that's the same position as the raycast is using?
would be better just to reuse the same variables
to be 100% sure
I don't quite follow? I see the line being traced directly below the character
yes but I want to make sure that your DrawRay call actually is drawing the same ray that your Raycast is using
if it's not, it's not helpful
it may even be confusing you
You have a raycastStart variable here
you should reuse this, even put the DrawRay right above this line of code
that will guarantee it's the same
It's a bit tricky to do that. The code is running on an event being triggered via an animation
how is it tricky?
You literally just need to write the Debug.DrawRay on the line right before the Raycast
it doesn't matter what's triggering it
DrawRay has a duration parameter you can use so it stays for more than one frame:
public static void DrawRay(Vector3 start, Vector3 dir, Color color = Color.white, float duration = 0.0f, bool depthTest = true);
https://docs.unity3d.com/ScriptReference/Debug.DrawRay.html
if that's your concern