Character being respawned after parented to WorldModel

I am currently having an error with a script, that does not show in output in any way.

When I parent a character to a WorldModel in terrain, it disappears after a few seconds and the character is respawned.

What could be causing this? I viewed my script and nothing parents it to workspace or respawns the character in any way once.

I changed the parent to workspace, same issue.

Try disabling players.CharacterAutoLoads maybe? Sounds like the reparenting of the character may be causing it to fire CharacterRemoving or in some way flagging as the character being removed. Only thing is that you’d have to manually load the character on the server though.

Well disabling autoloads might ruin the game itself, since this is a kind of thing that can be loaded across any game if you have permissions to run requires in any way.

Even if I were to quickly disable and enable it, there still might be a problem.

The odd thing is an older project I made contains the same WorldModel code, yet works perfectly fine unlike the current.

Could you try and see if it keeps the player from having their character removed though? You can still call player:LoadCharacter(), it’s just that it shouldn’t automatically cause a new character to be spawned once the character is removed/dies/similar

I suppose I could try.
One moment.

1 Like

Yes that seemed to work,

Now the issue is with the fact that characters wont load automatically afterwards, correct?

Yeah, you should be able to manually recreate character auto loading though. You’d just have to hook into humanoid.Died, then once that fires, optionally wait a certain amount of time, then respawn the character via player:LoadCharacter. You might need to destroy the character as well, not too sure if loading the character will remove the old character

Sorry for not responding fast I was working on effects for the project.
image

1 Like

Yes I suppose I could temporarily utilize this until I re-enable it, I just need to find out how long it takes to reload the character

And then that should be it,

I think.

Around 5.5 seconds

Player:LoadCharacter should load the character near-instantly, if not try modifying players.RespawnTime

Yes I know that, but I only need to temporarily utilize the manual respawn because it only respawns the character after ~5.5 seconds

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.