How do I rotate a sprite towards where objects collide?

0 favourites
  • 2 posts
From the Asset Store
Simple resize and rotate events for any sprite, quick and easy event sheet that you can use for your own projects.
  • I have an object which is destructible, meaning when the object is hit by the player I spawn a duplicate of this object which has been designed in Gimp to look destroyed. However, I'm struggling with rotating this towards the point of impact between these two objects. How can I detect where collision between objects occur?

    I've tried with something like Set angle to Sprite.XXX.Angle, which works kind of ok, as long as the "front" of the player hits the other object. However, if it is hit from the side of the player, it doesn't look as good.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • whenever an object collide that actually means its overlapping another object.

    General collision algorithms generates an area becouse of this, not a point. So you cannot get a point of collision happened.

    (i may be wrong on this issue not expert enough on construct 2)

    You may be find "overlapping at offset" useful on this issue. sou you can dedect from which side does it hits by using x,y coordinates in an object itself and manipulate the angle according to the side

    also this thread may help you too:

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)