How do I spawn a sprite on a certain spot when overlapping?

0 favourites
  • 7 posts
From the Asset Store
Minimal Sprite Font with Stroke for Pixel Art games.
  • I would like to spawn a sprite when a sprite makes collision with another sprite.

    Example would be player has a sword then player swings the sword to hit an enemy and when the sword hits the enemy then the collision part where the sword hits the enemy spawns slash/blood. How do I spawn a sprite at that spot?

    Right now, I only know how to spawn from player, enemy, or sword but it will not spawn in the correct spots when hitting enemies at certain angles and larger enemies.

  • You use image points, under the spawn action you'll see the Object but also Image Point. If you open the image editor, the default image point is 'Origin'. You can create other points on the image, and spawn things on them using the spawn action.

  • Thanks for the fast reply.

    I do use image points but is there a way to select a specific one based on location such as if the sword was to hit the enemy's foot then spawn based on that image point and if the sword was to hit the enemy's head then spawn from that point?

    I am looking for accurate positions in spawning slash/blood for hitting enemies in random spots. If not specific spots then it doesn't look accurate.

  • I use just one action (system pick) :

    Imagepoint 1 is the foot here so it breaks down as : if sword is colliding with the foot > spawn blood on the foot.

  • Thanks. This what I was looking for. Only problem is when hitting multiple spots at once then it will trigger both image points.

  • Well it will need tweaks for sure. You can put in a condition that checks if you're already overlapping an imagepoint then don't do this action. There's a detection in C2 for nearest/furthest. You could incorporate that somehow to find the nearest imagepoint to the sword and only trigger that one. It's all about investigation

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I see. I am having problems getting them to work correctly. I have tried if overlapping with image point 1 then 2 won't spawn and vice versa but neither will spawn. How do I get it to find the nearest image point without giving it a specific number of the image point? When I tried it wants a number for the image point.

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