UKismetMathLibrary::BreakRotator(FRotator InRot, float &Roll, float &Pitch, float &Yaw)
im struggling with float & roll, what does that mean?
UKismetMathLibrary::BreakRotator(FRotator InRot, float &Roll, float &Pitch, float &Yaw)
im struggling with float & roll, what does that mean?
Thank You
Hi Bamboo,
float = Floating-point arithmetic - Wikipedia
& = “pass by reference”. Meaning a memory address will be passed, instead of the float itself. Parameter (computer programming) - Wikipedia
Roll = the forward axis of movement.
Basically, parameters with an & are “out parameters”. You declare the parameter, then pass it to the function by reference. The function uses the reference to edit the memory. It’s a way to “return” data w/o using return.
float Roll;
float Pitch;
float Yaw; // all uninitialized
UKismetMathLibrary::BreakRotator(InRot, Roll, Pitch, Yaw);
// Now Roll Pitch, Yaw, have been set to the values taken from InRot
Take a UE4 C++ beginner course on Udemy (they go on sale for $15 all the time). It will save you a bunch of time and trouble
Hey, you’re welcome. Mark my answer correct if you liked it I’ve been learning UE4 since January. There are courses on Udemy that are very helpful. https://www.udemy.com/course/unrealcourse/ Cheers!