Open the door always away from player
Hello, im looking for solution to open the door always awas from player. At the moment my door is working with one Box Collision. Press 'F' the door is open - alway into one way.
As far as I know, I have to use two boxes, one on each side.
My question is, how to get the player position, in witch box he is, or maybe there are an other, easier, solution how to do this.
asked Dec 04 '17 at 11:56 AM in Blueprint Scripting
You could get the "UnitDirectionVector" from door to player and calculate its dot product with the door's forward vector. If it is negative, the player is behind the door, if it is positive, the player is in front of it.
Then it is a matter of picking the correct animation for each case.
This, of course, assumes the door actor is "facing" the door itself - if not, you could always just place an "arrow" actor inside it facing the proper way, I guess.
answered Dec 04 '17 at 12:38 PM
Follow this question
Once you sign in you will be able to subscribe for any updates here