How to connect one entity point to other entity point?

Hello, I need create game, where player have some components and he need join components. Each component may have 2 or more connection point. So, when player move component to other component and they points near they must be connected.

My question: How I can check point to point connection?

Also I created some example of component - Circuit Builder - PLAYCANVAS

1 Like

Make all the components snap to a grid? Then if everything is a uniform size the connectors should line up

I will have components with different size. So, my concept check some collision in point place.

I would probably create child entities around an object that you want to have connection points. The child entities would represent the connection points (and also infer an orientation for items that are to be connected). When connectable items come within a threshold distance from a connection point, they can snap into position.

I create child entity for object, and check child entity collision

This is my example -

3 posts were split to a new topic: How to snap entities to a grid in game