Help with making actor spawn transform correctly relative?

Hey all I’m working on a random tile generator that will spawn a new tile room when you open a door.

The doors are random and can appear anywhere and so when you open another door it could be n, e, s, w. I can’t figure out how to make the room actor spawn correctly relative to the door that spawns it. The way I have it setup only works on south-bound doors but any other direction and they will be transformed weirdly and misaligned.

It’s a simple maths problem but I’m not smart enough to work this out. Any help appreciated.

I ended up removing the function that aligns it to fit the entrance offset.

Then just took the “forward vector” x “-tile size” x “tile amount” and now the offset matches when it goes any cardinal way.

Thanks!