Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

Office Holiday

Epic Games' offices will be on holiday from June 22nd to July 7th. During this period support will be limited. Our offices will reopen on Monday, July 8th. 

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?

Product Version: UE 4.8
more ▼

asked Aug 03 '15 at 04:29 AM in Blueprint Scripting

avatar image

6 2 7 9

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

1 answer: sort voted first


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.

more ▼

answered Aug 03 '15 at 04:50 AM

avatar image

576 53 46 72

avatar image brianorbea Aug 03 '15 at 11:35 PM

Thanks for answering, I will try your idea

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question