Hello guys,
I am trying to implement a steering behavior based on boids, and I use Understanding Steering Behaviors: Seek as reference material.
Unfortunately I get stuck at the very beginning already and I just dont understand why.
Here is my code:
Vector3 desiredVel = (target - unit.transform.position).normalized * 25 * Time.deltaTime;
Vector3 currentVel = unit.transform.forward.normalized * 25 * Time.deltaTime;
Vector3 steering = desiredVel - currentVel;
unit.transform.position = unit.transform.position + steering;
When applying this code to move my unit, it can only move backwards, not forward or to the side. According to the tutorial however, it should make my unit gradually turn, and move forward. What am I doing wrong?