HI,
I have a very simple question that I’ve been unable to find the answer to.
Using Javascript, how do I call a game object based on that objects vector3 position?
I’m using grid based points to move objects around on a 2d array but I need to be able to call these objects based on where they are and not based on what they’re called.
Help greatly appreciated.
Thanks,
Keep a simple 2D array referencing each object and when you move them in the scene update the array too.
Could you place triggers at each grid pos?
how is your object referenced? Is it just floating out there or is a GameController tracking it and other like objects?
Using a GameController is nice since you can use it to keep display and track game information without having to rely on a objects to communicate with one another. In this case, you could say that you had 5 ships, and tell each of their grid locations just by doing a little math.