/// TELEPORT public ITeleportable TeleportTo(Teleport pTeleport) { //simulated on owner side if (!player.IsItMe) { return(null); } transform.position = Vector2.one * 666; player.SetActive(false); //small teleport delay DoInTime(() => { transform.position = pTeleport.GetOutPosition(); player.SetActive(true); SetDirection(pTeleport.OutDirection); SyncPosition(true); }, 0.5f); return(this); //transform.position = pTeleport.OutPosition.position; //SetDirection(pTeleport.OutDirection); //SyncPosition(true); }
/// TELEPORT public ITeleportable TeleportTo(Teleport pTeleport) { //simulated on owner side if (!Owner.IsItMe) { return(null); } Projectile newProjectile = game.ProjectileManager.SpawnProjectile( pTeleport.GetOutPosition(), Owner, config, pTeleport.OutDirection); ReturnToPool(); return(newProjectile); }