public void Update() { if (walkingMode) { physic.MoveForward(1.3f); } }
private IEnumerator WalkToTargetTask(float stopDistance) { // INIT TaskRunning = true; UnityEngine.Random.InitState((int)(transform.position.x * Mathf.Pow(10, 6))); float randomStopDistance = stopDistance * UnityEngine.Random.Range(0.7f, 1.3f); EnemyMovement.FaceTarget(transform, Target); // TASK while (targetDistance.MoreThan(randomStopDistance)) { physic.MoveForward(SpeedFactor); yield return(new WaitForEndOfFrame()); } // #dodgy - gives time to end the stop walking anim yield return(new WaitForSeconds(1)); // DESINIT TaskRunning = false; }
private void HippieWalkAround() { physic.MoveForward(hippieSpeedWalkingFactor); }