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"

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 check if sphere collision overlaps point light?

I have a character who can only cast spells while in shadow. Basically, I'm just checking if any point light can directly see the character. I am currently using an implementation that works by drawing a line trace from every other light in the level.

alt text

This is not scalable, and I have to further check against Directional Lights, SkyLights, RectLights, etc. UE4 has also warned that the Get All Actors Of Class node is inefficient. I am now trying to use a sphere collision attached to the character with radius 1000. I want to check for overlapping point lights within this sphere collision every frame, then draw the line trace. For whatever reason, point lights cannot be captured as overlapped actors or components and I want to know why. These are what I have tried.

1) SphereCollision -> GetOverlappingActors of class PointLight : No Point Lights are returned.

2) SphereCollision -> GetOverlappingActors of class -> Cast to PointLight : No Point Lights are returned.

3) SphereCollision -> GetOverlappingComponents : No Point Lights are returned.

4) Self -> GetOverlappingActors of class PointLight : No Point Lights are returned.

5) Self -> GetOverlappingActors of class -> Cast to PointLight : No Point Lights are returned.

6) Self -> GetOverlappingComponents : No Point Lights are returned.

7) SphereCollision -> ComponentOverlapComponents : No Point Lights are returned.

8) SphereCollision -> ComponentOverlapActors: No Point Lights are returned.

9) SphereCollision -> GetOverlappingComponents -> Cast to PointLightComponent : UE4 warns that the cast will always fail because PrimitiveComponent cannot be casted to PointLightComponent.

I've tried just about every combination of overlapping and point lights just never seem to be caught as actors or components. My sphere is set to OverlapAll and generate overlap events, I've tried setting point lights to generate overlap events as well. How can I make a sphere collision overlap with point lights?

Product Version: UE 4.21
Tags:
lights.png (168.8 kB)
more ▼

asked Mar 30 '19 at 09:29 PM in Blueprint Scripting

avatar image

joshua.nkj
6 1 1

avatar image ThompsonN13 Mar 30 '19 at 10:01 PM

i would think the issue is due to lights not having collision.

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

0 answers: sort voted first
Be the first one to answer this question
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