How can I programmatically change the location of each blueprint to match the actors location

I am new to Unreal Engine so I apologies for the lack of vernacular.
I have a voxel grid (which is basically many many cubes). The voxel grid was imported from a single fbx file and so each voxel has the same point of origin.

I created a simple blueprint action that I want to apply to each actor.

I tried to do this by selecting all of the actors in the World Outliner menu, then I selected my simple blueprint under Actor → Convert Actor. When I execute the blueprint action in the game play, the blueprint action executes correctly, however the blueprint action is not running in the respective location of each actor, instead the blueprints are all executing in the same location (origin 0,0,0).

How can I programmatically change the location of each blueprint to match the actors location?

You might be able to use the mesh location inside the BP, otherwise you need to sort out the cube pivot points.

In any event, you could quite easily make this sort of scene using a BP with a cube in and a bit of programming in the level BP.

Tell me if you want to know and I’ll put something together…

EDIT: Or you could just use:

@clockworkOcean thank you for the response. I should have mentioned that the locations of each cube needs to be preserved from the model, that can’t have random locations. What is a way that I can resolve the cube pivot points?
Can you explain more about a “mesh location inside the BP”?

If you’re somehow assigning a BP to each actor, then the mesh should be available inside the BP. You can get the world location of the mesh, rather than the location of the BP actor.

Another thing you could do is move all the pivot points with something like pivot tool:

I think it can convert multiple actors.

@clockworkOcean Thanks for the suggestion, I tried out the pivot tool and it worked, now each of the cubes has the correct pivot point. However when I select Actor → Convert Actor and select my blueprint (the blueprint has a sphere and a particalSystem) the sphere and particalSystem are again back at the 0,0,0 position and not surrounding the cube.

How can I modify the blueprint to surround each of the cubes?

I’m a bit confused about this whole process, too. Since it’s a single FBX file, the whole lot is considered a single Static Mesh Actor when placed in the scene.

308515-staticmeshactortoactor.jpg

You can then convert it to a blueprint actor with a graph and all the bells and whistles, sure.

When I execute the blueprint action in
the game play, the blueprint action
executes correctly, however the
blueprint action is not running in the
respective location of each actor,
instead the blueprints are all
executing in the same location (origin
0,0,0).

This leads me to believe that @bmwyss is trying to split this FBX into separate actors. Which is not possible afaik. It returns 0, 0, 0 because it’s just a single actor sitting pretty in the middle of nowhere.

Someone please do correct me if I’m wrong.

Ok, some progress :slight_smile:

Can you be a bit more specific about your conversion process. I don’t see ‘convert actor’ anywhere…

I had wondered that also… hence the question.

Every ******** time :expressionless:

Where was I…


If the goal is to manage a voxel-like construct made of many self-contained elements, I’d consider importing raw transform data instead and have Unreal do the heavy lifting. Either via static meshes or their instanced equivalents if we need thousands at a time.

Again, I’m assuming a lot here.

@ClockworkOcean, This is where I am using ‘convert actor’:

@Everyone - apologies for not being more clear. Yes - the goal is to manage a voxel-like construct made of many self-contained elements. I am able to import separate actors from a single fbx, I did this with these import settings:

Then with the pivot tool that ClockworkOcean suggested I am able to get each cube to have the correct pivot offset, in my case the center of the actor.

The last step I am trying to work out is to apply a blueprint to each actor, where each blueprint is located at the actors pivot point. I am trying to do this by selecting all of the actors and then using “convert actor” (see above image). However the blueprint does not end up at the pivot point of the actor, instead each blueprint is located at 0,0,0.

Another approach I am trying is to loop through the actors, capture their pivot points, and spawn a blueprint, but its not working:

Make a BP that works the way you want. Then just select all those cubes, right click, and replace them with the BP.

And here I was thinking I’m not going to learn anything today. Thanks!

Never worked with importing assets this way so not sure I can add to this. Not at the moment. I sure am eager to try it out, though. Once I do (tomorrow maybe) I’ll try to chip in if this is still unresolved. Or read up if it is.


Took me a while to even find this option: Import into Level. Now I feel like a missed a crucial tutorial years ago and have been living under a rock ever since. Never seen that menu before…

I’ve been relaying on exporting assets correctly, not the other way round. You live, you learn.

@ClockworkOcean I tried that, but the blueprint is at the point of origin 0,0,0 and not the point of origin of the actor.

@ClockworkOcean I just figured it out, I looked more closely at the pivot plugin tool you recommended, and I clicked the “bake” button which was the trick! It set the actor location from 0,0,0 to the correct value!

Thanks for all the help on this!

Rather than using ‘pivot offset’ what about just plain old ‘actor location’, that’s what you’d normally use when the pivot is in the correct place…

Ah, I was assuming you’d done that :wink:

The stuff from Nate is very good …