How to know which direction a car is facing?
Hello guys, I am currently working on a car game project and I want to make it impossible for the player to go in the opposite direction the race is going, so he always has to go in the correct direction. Any ideas on how to implement this?
asked Aug 03 '15 at 04:29 AM in Blueprint Scripting
you can make hidden indexed check points through your map on every corner (so actually it will be actors putted into array after creation), so when player come across one, write it in his custom player controller. Then in tick event in custom player controller BP check if player's car direction (you can get it with function called "GetRotation") are the same one as direction from player's car to next hidden checkpoint (actually it should be angle between 2 direction, if it's not more than 90%, then more likely player going in right direction.
Follow this question
Once you sign in you will be able to subscribe for any updates here