Page 1 of 1

How do I Shoot Bullet Object to Nearest Sprite

PostPosted: Sat Jul 30, 2016 6:26 pm
by chimchase
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!

Re: How do I Shoot Bullet Object to Nearest Sprite

PostPosted: Sat Jul 30, 2016 6:57 pm
by chimchase
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.

Re: How do I Shoot Bullet Object to Nearest Sprite

PostPosted: Thu Aug 04, 2016 2:42 pm
by badmoodtaylor
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)