// Update is called once per frame void Update() { //npc follows player if in range if (followingPlayer && !gameState.Safe() && gameState.CurrentState() == "Overworld" && !halt.isHalted()) { float step = moveSpeed * Time.deltaTime; Vector2 moveToPlayer = Vector2.MoveTowards(transform.position, player.transform.position, step); transform.position = moveToPlayer; circle.transform.position = moveToPlayer; } }
// Update is called once per frame void FixedUpdate() { if (thisCollider.IsTouching(player)) { if (!gameState.Safe()) { gameState.Dialogue(); gameState.SetInterlocutor(characterName); } } }