Hello! What I want to do is when bullet hits player he MOVES to the RESPAWN position. I don’t want it to move slowly, I want it to just appear at spawn point and the old player object destroys, the GUI Text “Respawn” would also be cool, so when I pressed it I respawn. It’s multiplayer so it must work well. Thanks in advance!
Read: Unity - Scripting API: Object.Instantiate
- Instantiate new player object at respawn position.
- Move camera to new player object.
- Destroy old player object.
You can also move player object instead of instantiate/destroy.
- Disable controls and collider.
- Reset position to respawn position.
- Enable controls and collider.
Well, if you move the position directly to the spawn point in one frame, you shouldn’t need to disable the controls or collider since the change will be instantaneous. Really, it’s as simple as one line of code saying “transform.position = spawnObject.transform.position;”. You’d probably want to reset the velocity of the character and any other state it has, too, though.