# How To Detect if object is in Camera View?

**URL:** <https://forums.unrealengine.com/t/how-to-detect-if-object-is-in-camera-view/380697>\
**Category:** Rendering\
**Tags:** Render, actor, unreal-engine, UE4, Blueprint, question\
**Created:** [January 2, 2017, 11:39am UTC](https://forums.unrealengine.com/t/how-to-detect-if-object-is-in-camera-view/380697 "2017-01-02T11:39:32Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![AmareshB](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/amareshb/32/852526_2.png) [@AmareshB](https://forums.unrealengine.com/u/AmareshB)\
**Post date:** [January 2, 2017, 11:39am UTC](https://forums.unrealengine.com/t/how-to-detect-if-object-is-in-camera-view/380697/1 "2017-01-02T11:39:32Z")

</div>

Hey! I’m looking for a way to check if certain object is in camera view or not? How can I do this?

I did thought of a workaround where I attached a view spectrum collision shape to the camera and if that shape overlaps something then its in view.

But it has many limitations like, you’ve to create the collision shape as per the camera field of view which won’t be accurate. And distant objects which are out of the shape area won’t get detected even if they are in front of the camera.

So, is there any functionality to detect the rendered objects in blueprint? Or any ideas for a workaround is also appreciated.

Thanks.

---

<div class="post-metadata">

**Author:** ![Fryderider](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Fryderider](https://forums.unrealengine.com/u/Fryderider)\
**Post date:** [January 2, 2017, 12:28pm UTC](https://forums.unrealengine.com/t/how-to-detect-if-object-is-in-camera-view/380697/2 "2017-01-02T12:28:02Z")

</div>

This might be what you’re looking for: [Was Recently Rendered](https://docs.unrealengine.com/latest/INT/BlueprintAPI/Rendering/WasRecentlyRendered/index.html)

---

<div class="post-metadata">

**Author:** ![Holybreath](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Holybreath](https://forums.unrealengine.com/u/Holybreath)\
**Post date:** [January 2, 2017, 12:34pm UTC](https://forums.unrealengine.com/t/how-to-detect-if-object-is-in-camera-view/380697/3 "2017-01-02T12:34:28Z")

</div>

up you go 🙂

---

<div class="post-metadata">

**Author:** ![AmareshB](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/amareshb/32/852526_2.png) [@AmareshB](https://forums.unrealengine.com/u/AmareshB)\
**Post date:** [January 2, 2017, 1:56pm UTC](https://forums.unrealengine.com/t/how-to-detect-if-object-is-in-camera-view/380697/4 "2017-01-02T13:56:21Z")

</div>

@Fryderider Thank you so much. It works perfectly.  
Is it a cheaper solution to use on multiple objects at the same time?

---

<div class="post-metadata">

**Author:** ![FilAl](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@FilAl](https://forums.unrealengine.com/u/FilAl)\
**Post date:** [November 20, 2017, 7:29pm UTC](https://forums.unrealengine.com/t/how-to-detect-if-object-is-in-camera-view/380697/5 "2017-11-20T19:29:18Z")

</div>

Aaaand here is a C++ way:

// lastOnScreenTime is a float, isVisible is a bool.

```
if (lastOnScreenTime != *(GetRootPrimitiveComponent()->SceneProxy->GetPrimitiveSceneInfo()->ComponentLastRenderTimeOnScreen)) { 

	isVisible = true; 
	lastOnScreenTime = *(GetRootPrimitiveComponent()->SceneProxy->GetPrimitiveSceneInfo()->ComponentLastRenderTimeOnScreen);

}
else { isVisible = false; }
```

---

<div class="post-metadata">

**Author:** ![Saaaaaaaaaamm](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Saaaaaaaaaamm](https://forums.unrealengine.com/u/Saaaaaaaaaamm)\
**Post date:** [November 29, 2018, 3:04am UTC](https://forums.unrealengine.com/t/how-to-detect-if-object-is-in-camera-view/380697/6 "2018-11-29T03:04:51Z")

</div>

LIFE SAVER

---

<div class="post-metadata">

**Author:** ![sita\_suman](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@sita\_suman](https://forums.unrealengine.com/u/sita_suman)\
**Post date:** [October 5, 2023, 5:18am UTC](https://forums.unrealengine.com/t/how-to-detect-if-object-is-in-camera-view/380697/7 "2023-10-05T05:18:14Z")

</div>

This link is not available  
PLz help me out

---

<div class="post-metadata">

**Author:** ![nande](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/nande/32/1057698_2.png) [@nande](https://forums.unrealengine.com/u/nande)\
**Post date:** [November 29, 2023, 6:56am UTC](https://forums.unrealengine.com/t/how-to-detect-if-object-is-in-camera-view/380697/8 "2023-11-29T06:56:15Z")

</div>

> **[AActor::WasRecentlyRendered](https://docs.unrealengine.com/5.3/en-US/API/Runtime/Engine/GameFramework/AActor/WasRecentlyRendered/)**
>
> Returns true if this actor has been rendered
