[Question] Setting up values from objects inside Bluprints (and debugging)

To explain what I try to achieve.
AffectedTarget is variable that store actor which was hit with trace.
Even On Effect Appiled is called AFTER the variable was set inside C++ code, so I assume it store to proper value.

Later I try to get target health value (third node), and assign them the Original Health variable.

Later there is math which should reduce target health for 5 seconds and restore it to normal value.

The problem is while I check debugger in VS the health of the target remain unchaged.

My questions:

  1. Do i trying to get value from actor in wrong way ?

  2. Or maybe the AffectedTarget variable is actually null, and there nothing to get the value from in the first place ?

  3. Which leads me to the last question. How do I preview BP variables values during gameplay ? It would make life much easier because I could just check what is going on.

EDIT:

Nevermind It works (the delay on function was actually do short to show in visual studio debugger proper values), but my third question remains. Is there a way to live preview values from BP variables while debugging blueprints ? It would probably save me from writing this post (;.

“Which leads me to the last question. How do I preview BP variables values during gameplay ? It would make life much easier because I could just check what is going on.”

“Is there a way to live preview values from BP variables while debugging blueprints ?”

Dear Lukasz,

I am hoping I am not providing you with answer that seems overly simplistic, but I can tell you exactly what I do to handle debugging during runtime from blueprints

There is a node called Print String

it prints to both the screen and the log

and you can choose the color of the onscreen display!


you can then do any number of branch tests and decide what sort of variables to output to screen

you do not have to convert your variables manually

just drag your variable straight into the print String input, and UE4 will do the variable conversion for you

such as

int → string

vector → string

etc

:slight_smile:

Enjoy!

Rama

You can also right-click on a pin or variable and choose Watch this value. If you then Play In Editor and leave the Blueprint open, you can select a debug object from the Debug Object dropdown menu on the top of the Blueprint, and watch the values live.

Cheers