I just CANNOT wrap my head around this, so im asking it here.
As seen in the Video i posted above, the “Wolf” and “Triangle” GO both have this script:
public class Wolf : MonoBehaviour
{
bool hittable;
[SerializeField] int HP;
bool isaggro;
[SerializeField] float Speed;
[SerializeField] Transform PlayerTransform;
Rigidbody2D rb;
void Start()
{
isaggro = false;
HP = 3;
rb = GetComponent<Rigidbody2D>();
}
private void Update()
{
FollowPlayer();
}
void FollowPlayer()
{
if (PlayerTransform != null)
{
Vector2 direction = (PlayerTransform.position - transform.position).normalized;
rb.MovePosition((Vector2)transform.position + direction * Speed * Time.fixedDeltaTime);
}
}
The Triangle is just for Testing purposes, and in the Video it goes directly into the player and it works fine. However the wolf goes to this one exact spot on the left of the player instead of right into the Player.
PlayerTransform is marked in red, but it also has no offset and all other parts of Player, including the Parent object, all yield the same result.
Why is this and what can i do?

