x

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"

How do I set up a "wrong way" HUD when actor is facing the wrong direction.

Hello!

I am building a racing game where the car is always facing north. I'm unsure how to create a blueprint where if the car is facing south then a "wrong way" text will pop up on the screen.

I'm having trouble figuring out how to get actor rotation and set a bool when the rotation is a specific number.

Cheers!

Product Version: UE 4.16
Tags:
more ▼

asked Feb 25 '18 at 05:40 AM in Blueprint Scripting

avatar image

patrickj114
1

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

1 answer: sort voted first

Determine this through the Dot Product of two vectors.

The two vectors would be

  • The North Vector

  • The Player Direction Vector (the forward vector of the player actor)

The possible values when you dot these two together can be seen here: http://chortle.ccsu.edu/vectorlessons/vch09/vch09_6.html

In that diagram, if red is the North vector and blue is the Player vector, then the value will be close to -1 when it is in the opposite direction. So you can check if the player is facing the wrong way when the dot value is, say less than -0.85

more ▼

answered Feb 25 '18 at 06:38 AM

avatar image

Ali Akbar
691 2 6 8

(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