Draw Debug Line With Vector


I created a Jump Pad based on this script :

In this video we create a Vector Variable Call “EndDirection” in the Event graph view and set the option “Show 3D widget” to True to be able to see the end of the vector

Always in the event graph, I Added a “Event Tick”: Connected to a Classic “Debug Draw Line” to display the vector in the view port, but the result is not was I expected.
I see the 3d Widget but the Debug Draw line goes in the opposite direction

Some suggestions to be able to display the vector in the viewport ?
(If I duplicate this blue print, my new jump pad draw me a line just above the first one (same direction, same axis, but not same ending)


Hello @Ze_Kurgan,

I think I understand what you are trying to do and I have come up with a really easy solution.

Your problem comes from the fact that Draw Debug Line requires world locations for both Line Start and Line End. The End Direction vector is in Local coordinates and you need a way to express it in World coordinates. This is why the line points to the center of the scene when you plug End Direction directly into the Line End field of the Draw Debug Line method.

You must add the End Direction vector to the World Location vector of whatever component you are using as the Scene Root of your blueprint. In your example it looks like you would add it to the World Location of JP Root.

Below is part of a simple Blueprint I made to help compliment my explanation above:

This is what the Blueprint looks like in the editor when I simulate the scene:

I hope my answer helps clear this issue up for you,


1 Like