Local to World Coordinates of Vector Variable?

Hi, anyone know there is an easy way to convert a local location vector to a global location? I can get it by translating via components, but looking for a faster/cleaner method.

By “translating via components,” I’m assuming you mean the Get World Location node for components?

That seems like the normal way to do something like this using a scene component (assuming you just want a location).

I’m not sure what all you are trying to do in this instance that would make that an “unclean” method, but off the top of my head I can’t think of a more straightforward method.

Thanks, and sorry, yes - should have been more clear. In BP #1 I am using an exposed/show gizmo location vector that I set in editor. At runtime, in BP #2, this location is then required in world coordinates. So, what I have done in the CS of BP #1 is create a ‘dummy’ cube, set its relative location to match the location vector, then pulled the dummy’s world location for my final use. This is what I meant as “unclean” - as creating the dummy object seemed a bit of a hack.

Okay, if I understand this correctly…

-You have a vector variable that you are already setting directly in the editor (exposed).

-You are putting a cube on top of it.

-You have a second BP getting the cube’s location (through I assume getting the actor with both the cube and the original vector variable in it).

I’m unclear on why you can’t just put the exposed vector variable in BP #2 in the first place, but I will assume you can’t for some reason.
Even in that case, you should still just be able to get actor of class of BP #1 and get the exposed vector variable directly. You shouldn’t have to put an object there on top of it. Even if it is a scene component, I believe get world location works fine on those just like any other component.

Thanks, and yes you understand correctly - but I’m still confused. The GetWorldLocation node requires a scene component object, which the exposed variable is not - correct? Accessing the exposed variable in BP#2 via a reference to BP#1 returns a vector - not a scene component? I must be missing something here… Thanks again for your help. Certainly not a deal-breaker issue for me but I would love to get a better understanding of this.

Yes, get world location requires a component. Because your post specifically asked for local to world location, I wasn’t sure if you were using a scene component or literally just an exposed vector.

If it is an exposed vector (so, not a component), then I’m not sure why you would need to convert from local to world because it wouldn’t be an object having a “local” location anywhere. …Or it normally wouldn’t unless you did something else strange to it.

If it is just a vector that you typed numbers into, then you shouldn’t need to do any local/world conversion to my knowledge. You should just be able to get the vector off the actor and use that.

Anyway, you know more about your project than I do. If the cube method is working, I guess just keep using that. :slight_smile:

Hah, yeah thanks for walking down this road with me and sorry for the unclear title. Yes, it is just an exposed vector. I am using it with a widget to set a location, which is then used by another actor in BP#2 as a LookAt Target - which requires me to use world coordinates. I suppose my use case is obscure enough to explain why there’s no local>World translation node. But, after all this - it just occurred to me that I should be able to use the world coordinates from BP#1 combined with the relative coordinates of the exposed vector to find world coordinates of the vector!

Did you manage to get this to work? I am really struggling with what I believe is the exact same issue. When adding them together, the rotation of the actor will not be taken into account as the relative position of the vector is not changed when the actor is rotated.

Oof, long time ago… I’m not sure what I was building here - but it seems like my last post explains how I achieved it?