Anyone know if there’s a way to watch what is setting a variable at runtime? I’ve got something, somewhere, changing the rotation of an actor and I’m trying to track it down.
You can set a ‘watch’ on the variable. It will catch the code that’s updating it…
Thanks, I have been watching it - but is there a way to see what is updating it easily? From what I gather, I would have to actually see a another bubble popup where it is being accessed, which in my case could be a number of places.
Edit, managed to track it down using the other debug tools. Would still love to know if what I’m asking is possible tho.
If you’re familiar with Visual Studio you can set data breakpoints that will automatically pause execution whenever the value at the specified memory address changes.
Thanks, I’m working in BP (should have made that clear). Would this approach still be viable?
Yes absolutely although I’d say it is more natural if you’re already working on a project that has some C++ or even if you just build the engine from source yourself.
It can get pretty involved depending on how easy you’re able to find the address of the object that you want to inspect. This is the tricky part that can depend on what happens in your game. E.g. if it’s an Actor that is spawned, you could start with a regular breakpoint in the SpawnActor
function. However if your game spawns Actors frequently then you’ll most likely have to step through many calls until you get to the desired Actor. Any specific function used only by your blueprint or at least not in many other things would also be a good candidate to identify the address of the object. Alternatively breakpoint conditions can also help but they can be tricky to get correctly as well since you need to find one that is specific enough for your object. E.g. if you know the address of the class of the object that can be used to restrict the breakpoint to any object of that class.
If you work with the installed version data breakpoints should work just fine. You probably need to start downloading the Debug Symbols if you haven’t done so when installing the engine initially. In Visual Studio you should then be able to attach to the running Editor (or Game).
Thanks for the detailed instruction. It sounds a tad involved for my current stumbling blocks, but I’m glad to have that arrow in the quiver!