Logo

Nearest object example

Created November 2015
66 plays

About This Project

In this example, we show how to find the object closest object to a label, and perform an operation to that object. This shows off how to do a kind of multi pass loop when dealing with spawned objects. Everything is commented, but leave a comment if you have any questions or are confused by anything.

Screenshots

Awards

First Play

Your first believer! Someone took a chance on you and played your project. Return the favour to another dev!

Level-Up

You are always working to improve your games. That's how you improve, good job!

Comments

SupaGuy7/4/2016

Hamed, when you helped me with this and made this it helped me, but for some reason now in my game, I have the following but it won't work: Timer (0 sec.)

  • calculate distance
  • if (calculate distance is less than or equal to 5000) -behavior on I would have emailed for help but I just emailed something about an hour ago and didn't want to overflow them with comments, besides this example also kinda applies so I'm just gonna post it here. Thank you.
Hamed11/17/2015

I don't have it checking if two distances are the same. What you could do is add a very small random values to the calculate distance to ensure that two distances are never equal.

This is sweet...I've wanted to figure out how to do this for some game ideas...but never figured it out!!!!

Aidan_Fire11/17/2015

Lol I managed to make 2 green circles 😝

Jack868011/17/2015

Pretty simple, and not really useful to me, but I guess it might help other people.