How to reference a batched actor in a level from a blueprint? (Eyedropper)

Hello UE Forums.

How do i reference a batched actor from with a blueprint?

I have made a batched actor in my level and i want to be able to reference it from a blueprint, that is also in the same level.

Using this code in my blueprint i can find that it is of the class “Actor” However using the actor variable and trying to pick it on scene does not work.

( I have tried Static Mesh Actor Type variable too)

Where am i going wrong? Is it because Im using the wrong variable type? or is it just not possible?

Thank you for taking the time to read this.

1 Like

Hi @Z3R0K0, I’m assuming (and plz correct me if I’m wrong) that you’re trying to reference a BP in the scene using a parent class ‘Actor’ directly without casting, and that will not work for you.

Multiple approaches you may try here:

  • In GetAllActorOfClass try to set your BP by name directly.
  • Keep using ‘Actor’ and use Cast node to your BP afterwards.
  • Use Get Actors with Tag instead, and add specific tag to your actor in the scene.

I’m not sure what you’re trying to achieve but plz note that using GetAllActorOfClass on BeginPlay is not always a good approach unless you have proper validation and retry logic, hope this helps.

You’re not doing anything wrong, this is just how batched actors work.

Batched actors are merged at build time and don’t exist as a normal placeable Actor instance anymore, so you can’t reference them with the eyedropper or store them in an Actor variable. That’s why the picker stays empty even though GetAllActorsOfClass sees them as Actor at runtime.

If you need to reference something directly, don’t batch it. Keep it as a regular Actor or BP. If batching is required, interact with it indirectly, for example via tags before batching, a manager BP, or by operating on the component data instead of the actor itself.

1 Like

@lAvArt-Studio @Davit35tik

Thanks for your replies. I understand it better now and i have come up with a “solution”. I’m only running this from Begin Play to test functionality. I was trying to find out if the batched instanced has stairs (because i need some extra logic for stairs)

This makes me able to find the correct components to attach the logic to. I would prefer if this was done on a “These actors only” basis, rather than get all actors. I can call this code when needed (e.g loading a level instance)

Surely there is a better way.