Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | Panagiotis Halatsako |
I’m trying to find the bounds of an area2d (width or width/2, height or heigh/2, x, y) having the following configuration. Each Area2D is a scene which will be a BaseTile2D scene further down if I figure out the snapping:
Area2d
|-> Sprite
|-> CollisionShape2D (Rectangle with variable bounds)
|-> ConnectorIn (Node2D)
| |-> North (Position2D)
|-> ConnectorOut (Node2D)
| |-> South (Position2D)
What I am trying to achieve is to have multiple tiles (not in a TileMap2D) which will snap to the edge of the next one, like a linked list:
[Starting Tile, ConnectorOut: [South]] → [Tile, ConnectorOut: [North], ConnectorOut: [South]] → [Tile, ConnectorIn: [North], ConnectorOut: [South]] → [Junction Tile, ConnectionIn: [North], ConnectionOut: [East, West]]
I’ve thought having Position2D to eligible snap positions, but when I instance the next tile I don’t see it even snapping the tile center to the Position2D.
Has anyone implemented something like this, outside TileMap2D ?