Was recently rendered node does not work

It always returns true even though the actor is far from being in the view

Hi Davision,

I just tested this in 4.12.5 3rd Person template and it’s working on my end. Here is what I did:

  • I created an actor class blueprint with a static mesh component

  • Then added the setup below to the ‘ThirdPersonCharacter’ blueprint

  • When the box is in view (being rendered) it registers True, when the box is out of view for 1 second it registers False.

What results do you get with this setup?

Tried it with a simple blueprint that is just a physics box and there it works fine. My more complex blueprint gives me always true, this are the components:

105109-asdaweresd.jpg

Could you also post a screenshot of your event graph setup? Or if you prefer, feel free to just post the .uasset that I can test.

It tested it just like you did with a print in the event tick. But the target was self.

I’ve the very same issue in 4.12.5. I consistently get bad results with the blueprint node Was Recently Rendered as well as AActor::GetLastRenderTime.

I have the issue even with simple actor blueprints. It seems to yeild true as soon and as long as the camera is moving while the actor resides in the frustum.

Way to reproduce:

  1. Create a fresh project (I used the content example)
  2. Create an Actor blueprint, add a static mesh component (I used a cube)
  3. Put it out of view range into the map
  4. Handle tick, output message if object was recently rendered

Actor setup and event graph:

Actor placed behind a wall:

Output:

Hi Eamid,

This is because the ‘Was Recently Rendered’ node only takes into account the frustum for code based optimization purposes. It isn’t the same as occlusion culling.

You can find it explained in a little more detail in this Forum post by Rama.

In 4.27 ‘Was Recently Rendered’ is always returning true. To test I made the same blueprint in 5.0ea2 and it works. Is this a bug that needs to be reported for 4.27?

Sorry, the function does work in 4.27, but for some reason when my game screen widget that shows my character’s health and stuff is added to the viewport, it stops working. I can’t figure out why this is happening because the WasRecentlyRender function seems to check the World for time passed. Which shouldn’t have anything to with a widget.

I found the problem. I was using a render target for my minimap. When the Minimap Blueprint with the RenderTarget was spawned is was rendering the actor I was checking with WasRecentlyRender.

1 Like

In case anyone has this issue, I’ll state my hacky wacky way of solving this “always true” problem for character blueprints in 5.4.

For context, I am making a weeping angel AI enemy that stops when rendered in view. The default character blueprint I used for the AI in my main level was always returning true when running the “was recently rendered node” for the body mesh, so I did some tests with a standard cube actor separately. The cube behaved as normal when running the function, stating true when looking at it in first-person and rendered on-screen, and false when off-screen.

I therefore placed a REALLY small cube on top of my AI character blueprint’s head and started to check if the cube was recently rendered instead of the whole body mesh. Lo-and-behold, it works! :grinning:

I know this doesn’t necessarily fully get to the root issue, but for people on a time crunch I hope this helped.

1 Like

Fixed, thanks for the lead @mpspence. All you need to do is make sure that the static mesh is not set to Moveable. If you change to mesh to either Stationary or Static then it will work as intended.

Edit: Sometimes Stationary doesn’t work, revert to Static if needed.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.