I want a user to be able to build streets tile for tile ingame. The street tile is 2000x2000 UU. I have made a blueprint for this street tile (it’s a straight street) with the static mesh and two attachment points (I use arrow components). Every attachment point has a collision box. If the user is in building mode, and the mouse cursor hits a collision box the street tile snaps to the attachment point of the already layed street tile. The collision box is a children of the attachment point, and with a function in the blueprint I get the location of the attachment point. This works very well.
My problem is, that I don’t know which of my attachment points are already connected. When I build a tile of the street and I build an additional every snapping is active nevertheless there is already a street tile placed. This could be solved by setting the collison box to inactive when I build a snapped in street tile. But I’m afraid that this is very unflexible (in future there should be more than one straight street tile, T-crossings, X-crossings and so on…)
Now I thought it would be better to not parent every collision box to one attachment point, there should be a struct with, collision box component, arrow component and a boolean is connected, and when this collision box is connected the tile should not snap in.
Is this a good way, or is it better to set the attachment point not in the street tile blueprint fix, instead every time I add a street tile the controller blueprint (which is responsible for building) sets a new collision box and one attachment point. This would solve the problem with the active collision boxes (also there is a performance hit, because there are fewer collision boxes, or?)
Or are there completely other ideas? Maybe my way is a one way street?
Thank you Dominik