Download

Report Bug For UE5 BP Component in Dedicated Server

My player controller have a custom component and in dedicated server have a bug let my game could not run.
The bug is that the new player join game ,server will create new controller but do not create the component, controller`s component is global.just one component object in game and all controller owning it. It should be correct that each controller has a single component, rather than all controllers have a common component.

What do you mean a controller component is global, you can’t have a global component a new component will be created for each controller.

The component is used to select mysql ,get character info to spawn a character and let owner(I had make a ref and in controller construction set self to the ref ) to posses it.
First player join game ,it is work. But when second join in game ,the component spawn the second player~s character and let first player~s controller to posses it.
I read the log, find that the component is only one. Second player~s controller had not spawn a new one (may be the first player had not spawn the component too). Second player~s controller~s component is get first player~s. Third player~s controller is get it too. so it~s only one component had create in game and all controller~s component ref is it.
So I debug a few time ago. I find that all component is spawn only one if it is I customed.Movement component is not affected.
I guess what CPP declares the component and call new() in the constructor is normal. However, blueprints are not created automatically.
I had make this blueprint node but it make a new bug that server and client spawn diffrent component and don’t recognize each other.

if its an actor component you should be adding it to that actor, the issue is most likely in your programming not the engine.

You means that player controller could not have some component like actor or other component?

I mean why are you calling to create a component rather than just having it attached to start with?