My game seems to randomly set users back to the starting team

A player joins on the starting team when they first join my game and they can touch other SpawnLocations in order to switch teams. However, seemingly at random, a player’s team is occasionally set back to the starting team. This is very inconsistent and I am not sure what causes this.

For context, I have checked every script in my game. I have checked every RemoteEvent that could do this. I have checked for every possible instance of TouchInterest that may be related. There are no explicit functionalities that can set a player’s team to the starting team. The only team that is set to AutoAssignable is the starting team. None of my SpawnLocations are set to neutral and all of them are enabled.

I have never had this occur before. If it matters, the map is rather large (3000x3000x3000 studs) and the SpawnLocations are scattered throughout. StreamingEnabled is off.

Is there some built-in functionality I’m forgetting that would cause this?

1 Like

Maybe you’re forgetting about the property “AutoAssignable”?

1 Like

Why would AutoAssignable set a player back onto a team? They’ve already joined and start there. I’m pretty sure it has no behavior after that initial join.

1 Like

Oh yeah, I didn’t read your post thoroughly. That’s weird.

1 Like

Check your scripts as they might cause this.

1 Like

A video or gif could provide more help, I think there is something you are missing in a script, check model scripts

The biggest issue with this is reproing it, otherwise I’d totally take a video.
I’ve used the workspace filter and CTRL + Shift + F to search my code for keywords that I think would do it. Would you have any suggestions on what to search for?

I’ve decided to refactor most of the code and put some tracking/prints at areas I suspect may cause it. Not sure how to repro it or if I fixed it, but time will tell.

I would move this to scripting support just because it’s very likely to get taken down on dev discussion :P

This is neither a scripting nor building query exclusively, so I was looking more for a discussion about it. Not sure there’s really a place that makes sense for this question but I’ll move it.

did you maybe leave the first spawnpoint as Neutral? that means that a player from any team can spawn there by chance, then on touch, it would change the team to the starting team if you set it to change on touch nvm, you explicitly said you didnt

I was finally able to repro this - once.

image


By the end of this, the player is on the starting team - not the expected team.

It looks like it’s either one of two things:

  1. Doing player.Team = game:GetService(“Teams”):WaitForChild(“TeamName”) may yield for too long, and instead defaults to the starting team?
  2. Repeatedly setting the team too fast resets it back to the starting team?

Neither of those possibilities seem correct, but these are my current theories. If anyone has any other ideas, please let me know.

The rare occurrence of this issue and the fact it’s happening in various games of mine that do not have shared code - I am leaning towards this being a Roblox engine issue.

I have started a bug report: Setting a player's team occasionally defaults back to the starting team