- Home /
After pressing the spawn button, use mouse to select another piece to spawn next to one of its sides
Im making a clone of the gameboard "hive", where i have these hexagonal pieces that have connect to each other by sticking to the sides of other pieces. So i have some buttons that you can press to select what kind of piece you want to spawn(they are different types of pieces, but the all have hexagonal shapes), and after you pressed one of them you need to select one side of an allied piece that is already in play for the piece to spawn connected to it.
The question is the following: how can go about doing this?
I have a script attached to a canvas that represents the gameboard where the pieces spawn, that manages all of the games logic, so i was thinking maybe to get a boolean that says whenever you are trying to spawn a piece for the update function to check and star raycasting for posible in-game pieces that have a side in which the piece can connect but i think this path is more intrincate than i think.
I'm rather new to unity and trying to find a solution to this over the past couple of days have prove to be quite challenging, so if you can give just a head-start of an idea would be nice.