Pending Review

Testing connection between objects

Gadget Kk 3 years ago updated by Lazlo Bonin (Lead Developer) 3 years ago 1

Hi Everyone,

Hoping someone here can assist me (i tried in Discord but didn't get a response so trying here now).

The current game i'm making is a puzzle game where you have to turn tiles to make connections from Point A to Point B. The part i'm struggling with is how to test if there is a connection between Point A and Point B.

The only way I think of (and seems like a really cumbersome way to go about it) is when an object is connected to Point A it has a bool that is set to true and if another object touches that one then it's bool is set to true... and so on down the line until it finally touches Point B and the point B object test for the bool on its connecting object.

Thoughts? Tips? Hints?

Thanks in advance!

Bolt Version:
Unity Version:
Scripting Backend:
.NET Version (API Compatibility Level):
Pending Review

Hi Gadget!

That actually sounds like a reasonable approach to me. You might want to use a While loop that moves on to the next object until you reach the edge of the map or a valid connection.