Is it possible to get the world location of a static mesh in an actor

I can get the world location of the root component with GetWorldLocation, but I need the world location of a static mesh attached to the root component. Is there a way to do that?

Thanks.

image

Right thanks, appreciate the response.

I’m probably using the wrong words and names for thing, so please bare with me.

I guess I should mention that I’m trying to get that location from a different blueprint and not the in the Actor itself. I can, and already have, cast to and created an array of object references for all the actors I want to get locations for. I don’t need the location of the actor (the scene root or scene component or the object being referenced). I want to get the location of a static mesh inside each of those objects

I already know that GetWorldLocation will give me the location of the scene component (which I called “root component” in the OP). What I don’t know is how to get world location of a static mesh that is attached to (but not directly on top of) that scene component.

Not quite sure what you mean, I’m afraid. If the BP has a static mesh in it, it doesn’t matter what it’s attached to, GetWorldLocation will do it.

Maybe show a bit of the internal structure?

GetWorldRotation returns the world location of the scene root/scene component/(the white ball in the viewport.)

My static mesh is not on that white ball, it is offset a ways. Once I rotate the actor, the scene root’s location doesn’t change in world space, but the static mesh’s location does as it has rotated around the root. I’m trying to get that new location from another blueprint.

I made a simple BP with an offset mesh:

The nodes return different values:

( I could be missing something :slight_smile: )

1 Like

I guess maybe that I’m asking the wrong question or I’m not saying something right, but it’s Ok because I think I found the solution.

I didn’t add the static mesh to the parent class that I was casing to, instead I added it to each child actor individually because each one uses a different static mesh. So my object references weren’t able to do diddly with the static meshes in the children. That is, I couldn’t plug the “cube” into the GetWorldLocation because there was no “cube” inside the parent to reference. Soon as I added it, I could access the SM and plug it right into GetWorldLocation.

I just have to go back now and change all the children to use the “blank” static mesh I added to the parent and remove the individual static meshes that I added to each of the children.

Sure do appreciate your time. Sorry I wasn’t more able to explain what I meant. Peace.

If you’re making a class like that, then put a mesh in the parent, you can always change it in the child.