Odd behavior when spawning an actor from gamemode.

[FONT=Helvetica Neue]Hello! I have been tackling this issue for quite a while now -I am trying to spawn an actor from my gamemode, and then run an event in that actor that changes the actors material depending on which team gamemode assigned it to.’
[FONT=Helvetica Neue]Now, the issue is that a) when spawning the actor, size variables in the transform do not have an effect Also, the material event (set to run on server, other options seem to not change anything) has some really bizzare effects: the material DOES NOT change to clients, the actor is invisible in viewport, and when the actors are told to print out the display name of their material(part of the event they are set in), (after it has been set), they return the correct material.
[FONT=Helvetica Neue]Is this a known issue? And how to fix it?
I am using a UE4.7 compiled from source, it is unmodified (excluding the addition of server target files).
[FONT=Helvetica Neue]Thanks!

We need to see what you’re talking about. You mention game mode and clients and let me just say that GameMode class only exists on the host and will not replicate to the clients. You need to make sure that any code for respawning executed on gamemode is calling another class that is available to the client. There is a tutorial on the wiki for handling multiplayer respawning in blueprint. It’s not very long and will probably help sort out your respawning code.

Alright, so more info is needed. What I am trying to do, in essence, is this sudo RTS game, where a player has multiple units in his control. Right now these units are “Actor”:s, and I am storing a team ID in them, and my plan is to, when they receive input, such as a mouse click, to check the controllers’ team ID (an integer), and compare it to theirs.

So, right now I am simply trying to spawn 2 of these actors, one for each team, at BeginPlay, in the gamemode. Is this the right approach?

I’m LITTERALLY having the exact same problem you are in the game I am currently working on. It’s a bit spooky actually. From what it sounds like you tested everything the same way I did. I would love an answer to this.

Alright, did some more testing, and it appears that things get more spooky as you go on.
If you disable dedicated server, then the listen server has things work *kind of *correctly. Scaling works with it, and material works for team blue. The thing is, team red has THE EXACT same node chain, and I am sure of this, as I just copy pasted the blue chain, and just manually set the material to a red one, the string to say “I am in the red team” (instead of blue), and the execution wire to come from the “on ownership red” event, which has the same settings, and copy pasted inputs, as the blue one. At this stage, time to bring in the screenshots: Dropbox - Error - Simplify your life

Before you complain about it being too small to read, be sure to click the picture, and it should open up dropbox’s fancy zoom tool, that seems to work really well.

Okay, I fixed the material issue by taking the event that worked, and adding a “team” input to it, which then determined which material it would actually use. I never found any option that was set differently between team red & blue spawns though. Still, the issue with the material change & scaling not replicating to clients persists.

Alright, I have now come up with a workaround! If you too are experiencing weird materials issues, make sure the event that sets the materials is set on “multicast”. This may be something you always need to do when dealing with networked materials changing, never touched it before. For scaling, you should add an invisible sphere/cube/whatever, and set that as the root, and scale your objects within the actor. If you need dynamic scaling, I suggest trying to do that with an event, first on server, if no work, then multicast.