- Home /
Unity Photon help! Transform.position (I'm struggling for days with this)
Im making an simple mp FPS game. I want the other player to respawn after being shot but this is what currently happens: https://youtu.be/NTmeUCS0OEI
Here's my movement code: https://gist.github.com/MelvinWeert/fac5b3430959133aa17c024d6faaddb2
Here's my code that I made for the respawn function:
public void TakeDamage(float amount)
{
Health -= amount;
if(Health <= 0)
{
this.gameObject.transform.position = GameObject.FindGameObjectWithTag("Spawn").transform.position;
}
}
Do you have a CharacterController on the hit object?
AFAIK, teleporting such object is not recommended unless you disable the component first, and enable it again after the teleportation
Thx alot for your comment. Havent thought about that yet. I got an rigidbody attached to the Player. $$anonymous$$aybe disabling that for a few seconds during the teleportation might fix the issue? I'll try it later today.
I guess you have a movement script on the hit object. Can you provide it?
Yes! Its too big so I uploaded it on github: https://gist.github.com/$$anonymous$$elvinWeert/fac5b3430959133aa17c024d6faaddb2
Your answer
![](https://koobas.hobune.stream/wayback/20220613013457im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
max players in orginal room 0 Answers
[Photon]Player vs. Player Collision 0 Answers
how do i apply damage to objects other that the player 1 Answer
PUN2 Chess game instantiation problem 2 Answers