Roginich
(Roginich)
June 28, 2016, 10:03pm
6
If not using two volumes, I would recommend using vector math to determine which direction of the door the player is currently standing at. Use any way you want to activate the door, then when the player interacts with the door (Use Key), run this blueprint.
In the image I run the dot product between the forward vector of the door and a vector from the door to target (player in this case). Dot products are awesome, as they return a value between -1 to 1 if working with unit vectors. (unit vector is a fancy word for a normalized vector, a vector that has a length of 1) You get the value 1 if two vectors are facing the same direction while -1 is opposite. 0 is perpendicular, or “left/right” if you may. Advantage over the multiple volume approach is that you can blend values here.
It does not matter how you decide to orient the door with this approach, it will always understand where the player is.
Dot product is used for a lot of tricks. All from determining how much a light affects a polygon to deciding if the player is within the field of view of an enemy. Make good use of it.
I have a question. What is the Overlap Target?
My first guess is Box collider. If so, I GET my “box collider” but cannot connect it to “Get Actor Location”. -Static Mesh component is not compatible with Actor component-