I am handling “Blueprint Used” on a “Primal Item Base” derived item in my inventory. Works fine, but I need to spawn an Actor into the world and I need that actor to be spawned on the server.
I can’t use SpawnActor because the primal item is an object not an actor and I get the complaints about connecting (the non-existant) world context pin.
I have tried getting the Game state object and using the “BPNet Spawn Actor at Location” function which does spawn my class but on the connected clients and not on the dedicated server.
Anybody got a way to spawn a server actor from an inventory object? or can I somehow spawn a server actor at game start from my mod I can then use for server access?
Did you try without a world context? I just tried the other day from a structure and it was successful. Alternatively, use a custom event and when you left click the box, at the bottom left of the window is options for the event. Just switch the drop down menu to “Runs on Server” and check off Reliable. This will run the event strictly server side.
From a placed structure is fine, it has an actual actor which I believe supplies the required world context.
I am trying to do this one from the inventory object which does not derive from Actor. The blueprint fails to comply with the missing pin error.
The event is marked as server side, but the BPNet spawn actor at location function still seems to only spawn the objects on the clients and not the dedicated server
This functionality already exists in the defaults for PrimalItems… why are you trying to reinvent the wheel?
Literally just search for “spawn” and I’m pretty confident you’ll find all you’ll need… that or look at the Raft’s PrimalItem as this does - essentially - the same thing?
Thanks, don’t want to reinvent the wheel, don’t want to replace the inventory item with a spawned raft (know how to do that), just want to be able to spawn a server side actor from an object blueprint (ie call spawn actor from object without the compile error).