Download

Line trace on button press is only working while character is moving

I am trying to get a basic dialogue system using line trace set up but I am reaching a few hurdles that I can’t seem to get past. My main issue currently is that my line trace is only firing while moving and I am not sure why.

A basic breakdown of what I have so far is a line trace that fires on F press, that checks if the player is within the collision box of my dummy character called “talkBlueprint”, if it is it will disable movement and bring up a dialogue widget, then a second press will remove the widget and re enable character movement. However, these functions only fire while my player character is moving.

Does anyone have any ideas on how to solve this, or alternatively any medication/zen like states I can reach to stop my head from blowing up while trying to construct a dialogue system?.. :smiley:

aed3d6c9b2035b6566dd5e6492b7d734e8f9f2d4.jpeg
This is for a non-rotating Paper2D character that only swaps flipbook when you change direction and doesn’t draw any vectors indicating direction (think top down RPG). The solution is below in post #7 for anyone who has a similar set up and is trying to get line traces working for a dialogue/battle/interaction system.

I’m guessing it’s the “get last movement input vector”. If you’re not moving, it’s going to return zero I am guessing. Can you use “get actor forward vector” instead maybe?

You could also use velocity, if it’s important that the player not be stationary. But yeah, that last movement input thing looks like the most likely culprit.

Unfortunately not, but yes you are correct, that is the cause! total brain fart moment, seems obvious now

I am using a paper 2d character in a top down 3d world and need full up/down, left/right vector coverage, unless I am missing a means of getting that from get forward/get right vector (which is highly possible!).

For up/down, there is get up vector. For left/right, you have get right vector.

Yeah I have tried using them as a substitute for the ‘Get Last Movement Input Vector’ node, but no luck figuring out how to condense both of the inputs plus and minus values into the ‘Vector X Vector’ node that controls my Line Trace Length. The trace just ends up being stuck at an angle no matter what I try.

Any ideas how I could do this Zireael? I’ll try and have a proper look tomorrow morning after some zzz’s when I can think more logically

Yep, just needed a clear head, solved it.
I took an enum that handled which sprite/flipbook to change to depending on direction, ran it through a ‘Select’ node, then fed a ‘Make Vector’ into each directional input. A awkward way of going about it but my character technically doesn’t rotate so no other options were giving me any vector data to use

9799d881e7178d702a5ca4be0004bd59559f5dc3.jpeg
Edit- added image incase its of any use to anyone else using a similar paper2d setup