How to get (x,y,z) values from a location or transform in C++

Just append a .(axis) to the value. For example,

MyVector.X

Will be the X value of the vector. The same works for angles, but with pitch, yaw, etc.

Actually, in general, if you append a → or . to an object (depending on if it’s a pointer or not), Intellisense will (sometimes very slowly) tell you the values and functions you have access to. Pretty useful for when you’re not sure what you’re looking for or if what you’re looking for exists.

3 Likes