How to use ABS in C++?

This is the final output and working fine as expected, Sir Thank You very very much .

if (GetControlRotation().Yaw > LocBottomValue || GetControlRotation().Yaw < LocTopVlue)
	{
		if (abs(-LocTopValue) < abs(-LocBottomValue))
		{
			FRotator rot = GetControlRotation();
			rot.Yaw = LocTopVlue;
			MyControllerRef->SetControlRotation(rot);
		}
		else
		{
			FRotator rot = GetControlRotation();
			rot.Yaw = LocBottomValue;
			MyControllerRef->SetControlRotation(rot);
		}

	}
1 Like