Hi,
So I am looking to have a main player dialogue prompt if there has been no input after a while. What would be the best way to implement this please?
Rather than detecting input directly, it's better to check if the Player isn't moving/talking while in gameplay:
using UnityEngine; using AC; public class RespondToWait : MonoBehaviour { public float waitTime = 10f; public ActionList actionList; private float timer; void Update () { if (KickStarter.player.charState == CharState.Idle && !KickStarter.player.isTalking && KickStarter.stateHandler.IsInGameplay ()) { timer += Time.deltaTime; if (timer >= waitTime) { timer = 0f; actionList.Interact (); } } else { timer = 0f; } } }
Works a treat thanks!
It looks like you're new here. If you want to get involved, click one of these buttons!
Comments
Rather than detecting input directly, it's better to check if the Player isn't moving/talking while in gameplay:
Works a treat thanks!