Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

How do I draw a debug line in the direction of my movement input?

I have a pawn that the left controller stick and keyboard (WASD) move it around with. I can also aim with the right stick.

I want to draw a debug line that faces the direction that the pawn's movement input is. I'm stuck on getting vectors to work. I have one debug line for my aiming that draws fine, but the movement one is tougher.

For example, if the character is aiming forward, but strafing to the left, I'd want to draw the strafing line.

Product Version: UE 4.10
more ▼

asked Jan 23 '16 at 04:41 AM in Blueprint Scripting

avatar image

732 41 38 60

avatar image durabo Jan 23 '16 at 10:56 PM

Hi, try something like this, not sure I follow exactly what you need but this will show you how to draw debug lines that follow your pawn while moving it, this nodes are from Character Blueprint.

alt text


1.jpg (128.5 kB)
avatar image jmalaska Jan 26 '16 at 02:59 AM

Thanks for the reply @durabo

I gave that a shot, but the line didn't draw out, it just was a dot. Was I doing that right?

In any case, here's a pic of what I'm trying to do. The GREEN line would be the facing direction of the player cylinder (that is easy...).

The RED line would be what the left controller stick is doing relative to the camera. (In this case, the left stick would be pushing right, and the player will move shortly after.) Does that make sense?

(This is just an MS paint example).

alt text

avatar image durabo Jan 27 '16 at 01:06 PM

Hi, sorry delayed response, I think you might need something like this.

alt text

If you want to make it happen camera rotation related instead of actor rotation related then try something like this, notice I dragged a Follow Camera to BP and get its world rotation instead of the Actor Rotaion. (also only showing for A/D same would be for W/S)

alt text


2.jpg (128.4 kB)
3.jpg (123.5 kB)
(comments are locked)
10|2000 characters needed characters left
Viewable by all users

0 answers: sort voted first
Be the first one to answer this question
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question