Use "Swap()" to Avoid buffer variables

Hello Sam and Ben,

Thank you very much for your lessons I love them so far.
During the lesson, in order to make the platform keep moving between the start
position and target position there is a buffer variable being used.

To save some time it is also possible to use the function: Swap(value1, value2)
This function is from the std namespace (std:: pre-fix wasn’t needed in the .cpp file) of C++.
In actuallity it does the same, however it is less of a hassle to use.

1 Like

Thanks Sotem, this is great for other students to use. I will rename the title of your post so they can find it. I realised Unreal has a swap after recording the lecture.

1 Like

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.

Privacy & Terms