[C++] How to debug in the constructor
My current problem is i want the purple arrows to point to each other. Essentially I want to show what objects are linked in the viewport, but I'm unsure on 1 thing.
How can I debug the constructor of a class WHILE MY GAME IS NOT PLAYING? My UE_LOGS are not printing, I tried to make the variable visible in the details tab but it seems to be more editable rather than live updating.
any help would be greatly appreciated!
asked Nov 07 '18 at 07:19 PM in C++ Programming
The problem is I wasn't looking in the right spot, The constructor is only called when the object is compiled or placed into the world. I needed a function that was called EVERY time the object was moved, (much like the constructor in the blueprints).
answered Nov 08 '18 at 02:24 AM
So do you want the arrows to update rotation in the constructor or do you want a property in the editor to update from the constructor and show its value live? To do that you would have to use post init properties function. Here is a link to the docs, near the top is a section called “setting defaults in my constructor” that talks about this. Let me know if that works.
answered Nov 07 '18 at 08:42 PM
We can debug on screen like this. Just make the changes to print out your transform, rotation, etc. (will need header #include "Engine.h")
Or in the logs likes this. Next to content browser labeled 'Output Log'
Hope this helps debugging!
Follow this question
Once you sign in you will be able to subscribe for any updates here