How do I set an actor's owner from Blueprint?

I have inventory actors that are supposed to be only relevant to their owner.

In the C++ version of SpawnActor and in previous Unreal Engine versions, there was the possibility to set the spawned actor’s owner. However, there seems to be nothing exposed to Blueprints, and there’s obviously no setter for an actor’s owner.

Is there any way to spawn an actor with a certain owner from Blueprint?

Hmm, this would allow me to spawn instances into streaming levels which I can’t currently figure out.

Would be a nice feature to have in BP!

I had the same problem trying to get the owner of a spawned actor. You can make one yourself by creating a variable in your spawned actor and set it to ‘Expose on Spawn’ in the details panel. When you use the Spawn actor function there will be an input you can pass the owner into.

Well, that’s a way to create a simple reference. But it does not solve the problem of not being able to set the Actor’s actual owner, which is used internally to determine network relevancy (bOnlyRelevantToOwner).

Is there an answer on this? I am trying to set the owner of a spawned actor through blueprints but there is no such option. I am using UE 4.4.3 editor.

What i am trying to achieve is in a multiplayer game, to spawn an actor that will be visible only to the playing character and no one else.

Did you ever find an answer for this? I am looking for a solution as well.

Nope, no solution yet as far as I know.

I wish there was a way to bump this question. I asked the same question in the forums before realizing I might look over here. I don’t really see how Multiplayer FPS can work in Blueprints without this functionality.
Edit: Okay, so commenting does bump. Hopefully some engineer will see it.

So what I had to do for this ultimately was create a C++ Wrapper for the Actor component. This is obviously a less-than-ideal solution as it doesn’t really help if you need to set the owner of a Pawn or Character (unless you want to redo your own Pawn/Character) but it did get my problem fixed.

For completeness, for anyone who comes by and sees this, from a Project that had zero C++, I simply went to File > Add Code to Project, that brought up a wizard that walks you through creating a class. Pick a base class of Actor, then give the class a name, say, ActorBPWrapper, and then it should generate the basic code project. (Don’t mess with the directory. Unless you’re planning on doing a lot more C++, I don’t think it will come up.)

From there, you’ll have two files: ActorBPWrapper.h and ActorBPWrapper.cpp.

Think of the .h file as “What the class does” and the .cpp file as “How the class does it.” So you want to put in the .h file (in between the { } (curly braces) but underneath the “GENERATED_UCLASS_BODY()” line):

public:
	
	UFUNCTION(BlueprintCallable, Category = Actor)
	void SetOwnerTo(AActor* NewOwner);

Then, in the .cpp file, you’ll want to put the following at the very bottom of the file (after the last } (curly brace)):

void AOwnedActor::SetOwnerTo(AActor *NewOwner)
{
	Super::SetOwner(NewOwner);
}

That should be pretty much it. I changed the name from “SetOwner” to “SetOwnerTo” because I didn’t want to actually try to override (or hide) the existing SetOwner function.

Like I said, it’s a less than ideal solution, but it’s fast and it works.

I should note that if they put that “UFUNCTION(BlueprintCallable, Category = Actor)” on top of the existing SetOwner function, it would fix this issue. And based on the content of the SetOwner function, I think that could be done without effort. Unfortunately I don’t know where to put this request.

I’m having a similar issue. I’m adding a weapon to the player, I’ve tried spawning via “Add ChildActorComponent” and “Spawn Actor from Class”. Both didn’t set the owner correctly.

In a Blueprint only solution I’ve been able to hack around this by detecting if the player is remote and manually hiding the weapon in its Blueprint.

In the future either a native function SetOwner or including this functionality in functions that attach actors to a parent would be incredibly useful.

This ultimately worked for me, though you should change the function
void AOwnedActor::SetOwnerTo(AActor *NewOwner)
to
void AActorBPWrapper::SetOwnerTo(AActor *NewOwner)

I’m having the same problem. I spawn a gun with two meshes, but i can only see the 3rd person mesh because i can’t set its owner.
That’s an essential feature. We have to make some noise so they see it and fix it.

got the same issue. Please make ‘set Owner’ callable by blueprints!

What do you do after this, I can’t see any obvious changes now that this is in the project.