Help with respawn script/forces?

Okay, so I have this really WEIRD issue, and wanted to see if anyone else had something similar or an ANSWER for this…

So, I have my player, and on collision with an object he’d go flying off into forever. I can get it to stop doing this by stopping the velocity, but after about 3 seconds, it randomly deleted the object (and subsequently, the camera attached and following him)

Doesn’t matter if I have it stop the force before, or after respawn (collision = death), but if I force it to move before that magical invisible timer goes off, it works fine…any idea what’s causing this? I can throw any code you guys are questionate about, but I’m at a loss here…

i would start for looking for destroy() commands in your script and throwing some debugs in.

That’s what I thought as well, but the only thing in this specific section that would do this would be in a commented section.

I think it may have to deal with this line → rigidbody.velocity = Vector3(0, 0, 0);
If I have it at death, the timer stops around 3 and the player is destroyed, if it’s after it respawns fine, THEN destroys it in about 2-3 seconds if I don’t put some more force into it…

Also, what debugs would you suggest? I just tried adding in some Debug.Log calls, but that came up with nothing.

Definatly sounds like there is a Destroy(GO, 3) somewhere.
the way to bugfix things that you dont know where its happening is to turn off all scripts, and turn them on one at a time

oh geeze, turns out it was the trail renderer I was messing with earlier. Apparently, there’s an autodestruct function that destroys the object it’s attached to if it runs out of time. SILLY ME.

Thanks guys for poking my brain hard enough to make it work…xD