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"

Detect light perceived by player camera

Is there a way to detect the sunlight intensity at a given spot? I want my character to look away when facing the sun or another intense light source but couldn't find a good approach for this yet.

Product Version: UE 4.19
more ▼

asked Sep 03 '18 at 08:41 AM in Blueprint Scripting

avatar image

31 4 4

(comments are locked)
10|2000 characters needed characters left

1 answer: sort voted first

One way you could go about this is tracing from right in front the eyes of your character into lightsources in a radius and the level directional light, AKA "the sun". If you hit the lightsource or nothing at all is because your character is seeing it and hence you can make it look in another direction. This is however a very basic implementation that you should work on to improve (like takingn in acount the actual direction the character is facing before doing the traces, calculating the intensity of the light hiting the character eyes based on distance, etc,etc), but it would be a good place to start from my perspective.

more ▼

answered Sep 04 '18 at 02:16 PM

avatar image

776 21 12 28

avatar image palinoiadev Sep 04 '18 at 02:30 PM

Thanks for your answer. The problem here is, that the light source (in case of the sun) is not at the position of the actual sun image at the sky. For other light sources that are not far away from the player, a simple trace would be a solution though.

(comments are locked)
10|2000 characters needed characters left
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