How to get (x,y,z) values from a location or transform in C++
I know how to retrieve the x,y and z values from a vector in blueprints (you just break the vector into it's multiple parts) but how do you accomplish this in C++? For example, I want to get the x-axis value of my game character in world space so I can get as far as:
which returns a FVector. But as far as I can tell I don't see how to break this vector up and grab an individual axis value. Any suggestions? Thanks!
asked Apr 10 '16 at 10:21 PM in C++ Programming
Just append a .(axis) to the value. For example,
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.
Follow this question
Once you sign in you will be able to subscribe for any updates here