public override void Respawn() { if (!IsServer || !IsDead()) { return; } base.Respawn(); StopMove(); CacheNetTransform.Teleport(spawnPosition, CacheTransform.rotation); }
protected override void EntityUpdate() { base.EntityUpdate(); if (IsSummoned) { if (Summoner != null) { if (Vector3.Distance(CacheTransform.position, Summoner.CacheTransform.position) > GameInstance.maxFollowSummonerDistance) { // Teleport to summoner if too far from summoner CacheNetTransform.Teleport(Summoner.GetSummonPosition(), Summoner.GetSummonRotation()); } } else { // Summoner disappear so destroy it UnSummon(); } } }
public override void Teleport(Vector3 position) { CacheNetTransform.Teleport(position + (Vector3.up * GROUND_BUFFER), Quaternion.Euler(0, CacheEntity.MovementTransform.eulerAngles.y, 0)); }