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 find rotation angle to face actor.

Hi, making a projectile with homing and I'm trying to have the projectile not home in on an actor if it is behind it. So the projectile would check with the actor and if it had to rotate 90 degrees or more in order to face it, it would decide not to home in on it. Is there a function or a formula I can use to filter this properly?

Product Version: UE 4.9
more ▼

asked Jan 01 '16 at 06:47 AM in Blueprint Scripting

avatar image

31 4 8 11

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

1 answer: sort voted first


There may be several ways to do this, but you might try this method:

  1. Get two vectors; one that faces in front of your projectile, and one that goes from your projectile to its target

  2. Get the angle between those vectors via algebra

  3. Do stuff based on the output angle


alt text alt text

The function in the second image was simply made with two vector inputs, and one float output. I don't know what conditions you want your bullet to track in, so sticking this on tick might not be the best method. Nevertheless, this code should get your logic up and running. Also, I threw this code together in the Third Person Character blueprint. You will probably want to call this from your projectile's blueprint.

Good luck!

more ▼

answered Jan 01 '16 at 03:02 PM

avatar image

James Wirick
36 7 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