Pushing a box in the angle of collision?

Well, I’m currently at a huge dilemma.

I have to find a way to move a box in the direction that I have hit it, but I’m not sure how to do that. The thing is, I’m working with vectors, and I do want my collisionPusher to still work, so I kinda have to stick with it.

So does anyone know how to do this? Pushing an object in the direction of a collision.

Thanks again!

Not understanding what you mean by “push”. If you’re using the physics system, a push is a vector acceleration, so you’re already dealing with vectors. If you’re not using the physics system, a push is a more abstract concept. Do you mean you want the object to move a little bit in a particular direction? The easiest way to do this is with a setPos() relative to the node you want it to move towards.


THANKS! You were right!

I used the setPos, and it worked like a charm.

Thanks once again drwr!