Original Post
Hi, I'm stuck on a problem, but am not sure why it's happening. Hopefully someone could shed some theory on what I should be doing. (No need for real code, only pseudo). I have any enemy patrolling an area in a simple manner. It travels horizontally, bounces off the wall (no energy loss) and travels in the opposite direction and th process repeats. However, if the user presses the "rotate" button, the level rotates 90degrees. In order to get the enemy to stay in its relative position, I mount it to the level as it rotates. However, since it rotates 90degrees, the object has to start travelling vertically in order to stay on the path it should. I've handled this change like this: -check direction -if vertical, stop force on x axis and apply force on y axis -else- -stop force on y axis and apply force on x axis. This works fine, however, when I rotate the level there's a slight offset. This offset accumulates and the enemy seems to end up far away from it's 'patrol zone' Why is it doing this? [Edited by - phi on August 24, 2006 10:24:23 AM]