Behavior is changed with the "else"

By moving the code into the “else” statement, we are now checking if the platform is too far before moving it. Which means that we are actually checking the platform location computed in the previous frame. In other words, the platform is moved beyond the limit for one frame, then at the next it’s moved to the end location, and then after that it starts moving in the opposite direction.

This could show as a glitch (e.g. showing through a wall), or worst, it could create bugs (e.g. kill the player through a wall)

3 Likes

Privacy & Terms