Check out this thread for how you can post code nicely on the forums: Using code tags properly
Is your code working?
Does ‘lastSide’ get set somewhere else that isn’t shown?
I would suggest that you execute ‘Flip()’ when it’s needed, rather than polling in FixedUpdate().
I would suggest that you capitalize your method named ‘Flip’ (it’s not broken as-is, it’s just common).