CharacterRespawner, SpawnPointManager, and Spawnpoint- v3.0.10 Unity 2021.3

Front Range

New member
I'm having a hard time getting the Character to actually spawn at spawnpoints that are definitely registering with the SpawnPointManager OnEnable (already checked with a Debug.Log), i have tried using Grouping values of -1, 0, and 7 (both on the SpawnPoint gameObjects in the scene, and the Character component CharacterRespawner) , I have tried all Shape modes, with and without Obstruction layer check (btw there is a large gc call at start when enabled), none of this seems to matter. SpawnPoints are adding themselves to the SpawnPointManager list, and looking at the CharacterRespawner method it seems to just add parameters for when using Obstruction check, then continues to base.Respawn with a modified position if Obstruction check was enabled, otherwise it returns transform.position which is where the player is laying dead. What am I missing here?
 
For clarity, you mean you can't get the player to spawn at said spawnpoint, defined by grouping? I actually have just touched on dynamic spawnpoints for an addon I am working on and by using grouping everything has worked as expected for me. They are altered at runtime so they can be used for "objective" spawnpoints etc. Like in battlefield if your team owns a flag in conquest, you can spawn at a location at close to the flag. I will be expanding this for squad spawning also, so you can spawn of a squad member if they are alive.

The position and rotation you feed in do not seem to matter. They come back altered (ref), and that seems to be all, I don't think what you feed in is actually accounted for along the way, but I have not dug into it. I simply tried by position first assuming I may be able to define a location and then the spawnmanager would choose a valid spawnpoint closest to that selected location. This did not work as I expected it would so I did not bother going that route. Instead I stuck with the spawn grouping and modify on the fly, which seems to be working great so far and with enough spawnpoints I can see spawn killing being eliminated (I did some quick tests on this).

In saying that if we could use position to also influence the returned spawnpoint, that would be awesome!

-1 should ignore grouping, so forget using that for any chosen spawnpoints.

I have not tested without obstruction check.

Make sure your obstruction layers are correct, avoid having "Default" included.

Make sure respawner component has same grouping as the spawnpoints you wish to spawn at, which you obviously did. I do this by code, which maybe the only difference, so unsure if changing in inspector has the same result (possible inspector bug?).

I have successfully spawned in 4 teams at 4 different groupings like this. And the amount of teams can be unlimited really.
 
Thanks for your interest, to clarify just trying to get the character to respawn at a random spawnpoint after death in a single player game. In my case, there are four empty go's with Spawnpoint component added.
The Grouping is not really needed or necessary for my needs, however i did try -1, 0 , and a positive int just to make sure it wasn't part of the issue.
I could go ahead and script in a runtime method to force the respawn but i thought that was what SpawnPointManager was for hehe..
 
Is it failing on the obstruction check? If you disable checking for obstructing objects does it work?

A good example for the standard flow that it should follow is in the demo scene - each zone has a different group index that is used to respawn the character if they die while in that zone.
 
Top