Download

Stop player going wrong way?

Is there an easy way to get a message to screen if the player is going the wrong way?

If the desired direction is a simple vector direction, in blueprint you can take a dot product between the player’s forward vector (or maybe player’s normalized velocity) and the vector direction. The dot product gives a value between 1 and -1. It’s 1 when the player is faced or moving perfectly towards the desired direction, or -1 when the player is facing perfectly away from the desired direction. So, you could do a test with this dot product, if it is for example less than 0 (±90 degree from the desired direction), show the message. Else hide the message.
That’s one simple solution, but it depends on how you define “wrong way”.

Hi pontori thanks for that is there an example somewhere

This should be in blueprint scripting or C++ Gameplay Programming, not Content Creation.