How do I make an object point towards the nearest object?

Get help using Construct 2

Post » Thu Jun 01, 2017 11:48 pm

In a game that I'm creating; I'm trying to have an arrow point towards a spawned enemy. How do I do this?
Atm the enemies are not moving. Just setting the arrow angle towards (enemy.X, enemy.Y) just seems to point towards a random one, but I want it to point to the nearest.

I've tried looking around the forums, but all I could find is this post from 2011: [https://www.scirra.com/forum/nearest-instance_t63017]
B
3
Posts: 1
Reputation: 177

Post » Thu Jun 01, 2017 11:57 pm

enemy pick closest to arrow.x, arrow.y, arrow set angle to enemy
Image ImageImage
B
169
S
50
G
173
Posts: 8,321
Reputation: 110,286


Return to How do I....?

Who is online

Users browsing this forum: beohs and 8 guests