Alright, so this is something I’ve never quite figured out how to do efficiently.
You could have:
//true = was last in the if statement
//false = was last in the else statement
if (/*not important*/)
last = true;
last = false;
This is a technique that I’ve always used to circumvent this problem, but I was just wondering if there was a more efficient way of doing this.
The situation I’m dealing with now is I want to switch between two different camera positions and be able to tell WHEN it switches modes. If I know when it switched, I’ll use some special code to lerp it to the correct position.
I’m sure I could use this method or something similar, but I just wanted to minimize my use of variables.
Thanks if anyone can help!