How do I Shoot Bullet Object to Nearest Sprite

Just started using Construct 2? Post your questions here

Post » Sat Jul 30, 2016 6:26 pm

Greetings,

I'm having issues making a bullet object shoot towards the nearest sprite object. In my case I would like to spawn a bullet that collects coins. There are several copies of the coin sprite and I would like it to curve toward the closest one.

I'm not sure if I can maybe set a turret behavior or something?

Thanks!
Image
B
21
S
6
Posts: 40
Reputation: 1,357

Post » Sat Jul 30, 2016 6:57 pm

I was able to achieve this with the turret action applied to a sprite that I set to follow my character. Hope this helps somebody else.
Image
B
21
S
6
Posts: 40
Reputation: 1,357

Post » Thu Aug 04, 2016 2:42 pm

Here's what I would think initially.

Pick closest instance to player.x player.y
--spawn bullet
--set angle to angle(player.x, player.y, instance.x, instance.y)
ImageImageImage
B
44
S
26
G
11
Posts: 520
Reputation: 10,506


Return to Beginner's Questions

Who is online

Users browsing this forum: No registered users and 2 guests