Breakpoint conditions for UStructs? (Debugger thinks FVector is a "union_128")
I have what seems like it'd be a fairly common problem - a player's position getting set... somewhere... to an invalid value. I'm trying to track it down.
I'd like to set a data breakpoint which triggers if the player's RootComponent's ComponentToWorld transform's Translation.Z value is < 0. (In my test level, the player ends up underground.)
However, while I can set the data breakpoint to watch the ComponentToWorld.Translation FVector, any time I try to go deeper into the nested structures I run into problems. The core issue seems to be that for some reason the C++ debugger thinks that ComponentToWorld.Translation is something called a "union_m128" rather than am FVector, and therefore doesn't have a .Z member.
I've tried casting the ComponentToWorld.Translation back to an FVector, and it didn't help. I'm assuming that the problem is related to some sort of low-level platform math issue, where every platform has, under the hood, a different implementation of some basic math functions, but I have no idea how to work around that.
Has anyone gotten this working, or have any idea how to work around it? It seems like a really common problem, and exactly what data breakpoints are meant to solve.
I never found a way to convert the __m128 back to an FVector, but by examining the value with a watch, I was able to find the data.
The __m128 appears to be a generic structure which just... contains 128 bytes of data in various configurations for reasons I don't understand, in the form of multiple arrays which store various basic data types of different sizes.
I found the Z-value of the vector here: Translation.m128_f32
answered Oct 17 '17 at 11:07 PM
Follow this question
Once you sign in you will be able to subscribe for any updates here