# Best way to chek is any part of actor visible

**URL:** <https://forums.unrealengine.com/t/best-way-to-chek-is-any-part-of-actor-visible/357216>\
**Category:** Blueprint\
**Tags:** Trace, unreal-engine, Blueprint, question\
**Created:** [May 12, 2016, 12:15pm UTC](https://forums.unrealengine.com/t/best-way-to-chek-is-any-part-of-actor-visible/357216 "2016-05-12T12:15:27Z")\
**Posts on this page:** 15\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ignisor](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Ignisor](https://forums.unrealengine.com/u/Ignisor)\
**Post date:** [May 12, 2016, 12:15pm UTC](https://forums.unrealengine.com/t/best-way-to-chek-is-any-part-of-actor-visible/357216/1 "2016-05-12T12:15:27Z")

</div>

Is there any good solution how to chek is any part of actor visible?

For example:

 ![90321-example.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/0/d/a/0daad85a98dc8c560ec1256d7d0457e1930ac8d6.png)

Enemy is partly behind the wall. And if i simply trace for it, trace will be blocked by wall, but player can see part of enemy.

Is there a better way than just tracing every part of the enemy?

Thanks for any help. And sorry for my English)

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_210522a1](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_210522a1](https://forums.unrealengine.com/u/anonymous_user_210522a1)\
**Post date:** [May 12, 2016, 4:36pm UTC](https://forums.unrealengine.com/t/best-way-to-chek-is-any-part-of-actor-visible/357216/2 "2016-05-12T16:36:08Z")

</div>

Interesting question! I would like to know that too 😃

---

<div class="post-metadata">

**Author:** ![Ignisor](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Ignisor](https://forums.unrealengine.com/u/Ignisor)\
**Post date:** [May 12, 2016, 5:19pm UTC](https://forums.unrealengine.com/t/best-way-to-chek-is-any-part-of-actor-visible/357216/3 "2016-05-12T17:19:53Z")

</div>

Vote for this. It will attract more people. Or not 🙂

---

<div class="post-metadata">

**Author:** ![mdonge](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@mdonge](https://forums.unrealengine.com/u/mdonge)\
**Post date:** [May 12, 2016, 5:33pm UTC](https://forums.unrealengine.com/t/best-way-to-chek-is-any-part-of-actor-visible/357216/4 "2016-05-12T17:33:30Z")

</div>

I would like to know too !

---

<div class="post-metadata">

**Author:** ![ClaudioPiccinni](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@ClaudioPiccinni](https://forums.unrealengine.com/u/ClaudioPiccinni)\
**Post date:** [May 13, 2016, 11:35am UTC](https://forums.unrealengine.com/t/best-way-to-chek-is-any-part-of-actor-visible/357216/5 "2016-05-13T11:35:57Z")

</div>

I don’t know if you can extrapolate something from this to help with your problem.

> **[Multi-color Outline Post Process in Unreal Engine](https://www.tomlooman.com/unreal-engine-outline-multi-color-post-process/)**
>
> Post Process using Custom Stencil and Custom Depth in Unreal Engine 4.9 and above to display a multi-color outline post process effect.

---

<div class="post-metadata">

**Author:** ![Ignisor](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Ignisor](https://forums.unrealengine.com/u/Ignisor)\
**Post date:** [May 13, 2016, 2:04pm UTC](https://forums.unrealengine.com/t/best-way-to-chek-is-any-part-of-actor-visible/357216/6 "2016-05-13T14:04:59Z")

</div>

I thought about it. But I don’t understand how to get scene texture, and how to work with it in event graph. And if it possible, it’s still based on render. But i need to check actors that not on screen.

---

<div class="post-metadata">

**Author:** ![iUltimateLP](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@iUltimateLP](https://forums.unrealengine.com/u/iUltimateLP)\
**Post date:** [May 13, 2016, 2:06pm UTC](https://forums.unrealengine.com/t/best-way-to-chek-is-any-part-of-actor-visible/357216/7 "2016-05-13T14:06:24Z")

</div>

You could do a line trace for every degree between 0° and 180°, so you basicially check the whole region in front of you. If none of those traces finds the char, you know that he isn’t there… Obviously, that’s not the best solution, but it would work…

---

<div class="post-metadata">

**Author:** ![Ignisor](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Ignisor](https://forums.unrealengine.com/u/Ignisor)\
**Post date:** [May 13, 2016, 5:04pm UTC](https://forums.unrealengine.com/t/best-way-to-chek-is-any-part-of-actor-visible/357216/8 "2016-05-13T17:04:15Z")

</div>

I hope there is more elegant solution exist.

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_210522a1](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_210522a1](https://forums.unrealengine.com/u/anonymous_user_210522a1)\
**Post date:** [January 18, 2017, 7:44pm UTC](https://forums.unrealengine.com/t/best-way-to-chek-is-any-part-of-actor-visible/357216/9 "2017-01-18T19:44:06Z")

</div>

After a lot of time I somehow got to think about this question again, you can easily do this with a SPHERE trace for MULTI objects with the channel visibility. And then casting the results to your Class until you have hit that class or are out of results.

C++ variant:

```
			TArray<FHitResult> OutHit;
			InActor->GetWorld()->SweepMultiByChannel(OutHit, Start, End, FQuat(), ECC_Visibility, FCollisionShape::MakeSphere(50 /*Character height*/), FCollisionQueryParams::DefaultQueryParam, FCollisionResponseParams::DefaultResponseParam);
			for (int i = 0; i < OutHit.Num(), i++)
			{
				AActor* /*Actor class*/ Tester = Cast<AActor /*Actor class*/>(OutHit[i].Actor);
				if (Tester)
				{
					return Tester;
				}
			}

```

//Written in 5 mins, not tested but should work, may need to check the returning 😉

I know it is late, but I thought I would write it anyway;

---

<div class="post-metadata">

**Author:** ![jackey7](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@jackey7](https://forums.unrealengine.com/u/jackey7)\
**Post date:** [January 2, 2018, 3:12am UTC](https://forums.unrealengine.com/t/best-way-to-chek-is-any-part-of-actor-visible/357216/10 "2018-01-02T03:12:09Z")

</div>

I would like to know too !

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_868e5950](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_868e5950](https://forums.unrealengine.com/u/anonymous_user_868e5950)\
**Post date:** [February 8, 2019, 4:49am UTC](https://forums.unrealengine.com/t/best-way-to-chek-is-any-part-of-actor-visible/357216/11 "2019-02-08T04:49:14Z")

</div>

If occlusion culling is enabled (which is highly recommended for performance), you could use the WasRecentlyRendered function.

---

<div class="post-metadata">

**Author:** ![DavidOConnor](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/davidoconnor/32/978533_2.png) [@DavidOConnor](https://forums.unrealengine.com/u/DavidOConnor)\
**Post date:** [February 8, 2019, 7:24am UTC](https://forums.unrealengine.com/t/best-way-to-chek-is-any-part-of-actor-visible/357216/12 "2019-02-08T07:24:55Z")

</div>

I don’t mean to derail this discussion… and I know the following sounds utterly mad and I haven’t tried it… but it just might work and be very efficient… is it possible to add pawn sensing or AI perception to the player controller?

---

<div class="post-metadata">

**Author:** ![Draterlluf](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Draterlluf](https://forums.unrealengine.com/u/Draterlluf)\
**Post date:** [February 12, 2024, 3:55am UTC](https://forums.unrealengine.com/t/best-way-to-chek-is-any-part-of-actor-visible/357216/13 "2024-02-12T03:55:22Z")

</div>

Replying since this is one of the top results on Google. Is there an elegant solution to this one yet?

If I’m understanding the proposed SweepMultiByChannel solution, I believe that will have the opposite effect, where the trace will be blocked before getting to the actor in all scenarios except where the target is completely visible to the sweep. In other words, if 90% of the target is exposed, the trace will still be blocked by the wall covering the other 10%.

The only way I can think to solve this (with my limited knowledge) is to perform multiple traces around the edges of the target, and consider the target “visible” if at least one hits.

---

<div class="post-metadata">

**Author:** ![usa423](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/usa423/32/918773_2.png) [@usa423](https://forums.unrealengine.com/u/usa423)\
**Post date:** [February 12, 2024, 4:32am UTC](https://forums.unrealengine.com/t/best-way-to-chek-is-any-part-of-actor-visible/357216/14 "2024-02-12T04:32:07Z")

</div>

This seems like there should be an easy solution, but in my Beat Em Up template, the only thing I found I could do was create a box collision about the size of the playable / viewable screen to know if things are there or not within that box.

---

<div class="post-metadata">

**Author:** ![droppedmartin03](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@droppedmartin03](https://forums.unrealengine.com/u/droppedmartin03)\
**Post date:** [July 6, 2025, 3:32pm UTC](https://forums.unrealengine.com/t/best-way-to-chek-is-any-part-of-actor-visible/357216/15 "2025-07-06T15:32:21Z")

</div>

From what ive found, this worked for me. ["WasRecentlyRendered" node returning true even after being occluded by walls - #5 by 192445](https://forums.unrealengine.com/t/wasrecentlyrendered-node-returning-true-even-after-being-occluded-by-walls/1870487/5) Its the one using GetLastRenderTimeOnScreen();
