void Movement() { v = ((transform.position - enemyTarget.position) * maxVelocity).normalized; force = v - CurrentVelocity; CurrentVelocity += force * Time.deltaTime; transform.position += CurrentVelocity * Time.deltaTime; aiMan.mass = aiMan.startMass; aiMan.maxSpeed = aiMan.startMaxSpeed; aiMan.AiSteer(v); }
void Movement() { //Not needed can fix, look into Djikastro/navmesh v = ((tmpTarget.position + aiEnem.velocity - transform.position) * maxVelocity).normalized; force = v - CurrentVelocity; CurrentVelocity += force * Time.deltaTime; transform.position += CurrentVelocity * Time.deltaTime; aiMan.mass = aiMan.startMass; aiMan.AiSteer(v); }
// Update is called once per frame void Update() { v = ((transform.position) * maxVelocity); force = v - CurrentVelocity; CurrentVelocity += force * Time.deltaTime; transform.position += CurrentVelocity * Time.deltaTime; aiMan.AiSteer(v); }
void Seek() { v = ((tmpTarget.position - transform.position) * maxVelocity).normalized; force = v - CurrentVelocity; CurrentVelocity += force * Time.deltaTime; transform.position += CurrentVelocity * Time.deltaTime; aiMan.AiSteer(v); }