public override void Update() { if (GalaxyVector3.Distance(transform.position, player.transform.position) < 2) { return; } GalaxyVector3.LerpOptimize(transform.position, player.transform.position, instance.Time.deltaTime * 0.7f); }
public override void Update() { physics.ApplyPhys(); distanse = GalaxyVector3.Distance(room.forseTarget, transform.position); if (distanse > 20) { physics.AddForсe((room.forseTarget - transform.position) * 2f); } else { physics.AddForсe((transform.position - room.forseTarget) * 6f); } }