Tip: Rotating an object against a wall

edited October 2012 in General discussions
This thing has been dogging me for days, and having managed to sort it out, wanted to share it in case anyone else ever comes across the same problem.

I needed to have an object travel along and when it hit a wall, attempt to rotate and turn against it. It was necessary in my game that the pivot was in the corner rather than the centre (for reason not important here).

The problem was that the pivot was on the wrong corner because the object was traveling in the reverse direction.

So while I used an orxObject_SetRotate on my object, the blasted thing would never turn while against the left wall. It would turn ok only against the right wall.

I had a second graphic, flipped with a pivot set on the opposite corner to deal with going left in the config but orx ignored it.

Anyway bottom line... if your object won't rotate against another, check your pivot.
Sign In or Register to comment.