- Home /
Disabling a player in multiplayer then teleporting it to a different place
Hi, so im making a game where the player is running around a map with others in a multiplayer game, and when they collide they will be disabled, and replaced with a ragdoll, the ragdoll will be destroyed shortly after, and the player will be reactivated and teleported to a spawn area. Know how to do that? Thanks in advance! :)
Answer by logicandchaos · Feb 10, 2021 at 02:22 PM
player.gameObject.SetActive(false);
ragdoll.transform.position=player.transform.position;
Destroy(ragdoll.gameObject,1f);
player.gameObject.transform.position=new Vector3(1,1,1);
player.gameObject.SetActive(true);
@logicandchaos Thanks! now the only thing I need is the proper way of calling the ragdoll. Do i use GetComponent or something? Sorry I have been practicing my code and the variable and object finding is one of my weakspots.
Your answer
