Check if a component rotation is in front of another component?


Im working on a room placement system . in short the player can place rooms in the world that are just a prefab / blueprint, rooms can only be placed if one of its doors is overlapping another room door so they are connected

Right now im doing the collision check as the following:
If only the room door is overlapping another room door then it sets the room to placeable and places it in the world, if the whole room is overlapping the room then it is set to not placeable ( since placing a whole room inside another room would be silly : p)

This works rather well

But again, since im just checkng if the rooms overlap it can lead to this

As you can see the room door is overlapping another room door and hence its set to placeable
So i believe that checking if the rooms rotation / orientation( front, front, left, left ) is the same it would solve the problem so only doors that have the same direction can be placed next to each other

Vector mathematics, Check out info about dot product, and cross product with that functions u can make orientation check.

Thanks, but math isnt my strong side is it possible you could guide me in the right direction?

I haven’t used that in UE4 yet (i am newbe in ue4) i was just doing such stuff in unity before. there u are a link which can give u some adivce
U should be able to find dot function in FMath library. There are alwso math examples in ue4 content examples.