Hello,
I am trying to come up with a script that gets the position of a target minus a certain amount of units (lets say 2)…
I came up with:
var dir = hit.transform.position - transform.position;
var enemypoint : Vector3 = hit.transform.position + dir.normalized * 2;
It gives the position minus 2 units but it’s always at a fixed place from the enemy (let’s say always on the left)
I need the position to be 2 units away from the enemy facing the player if you know what I mean… It’s hard to explain. This way I can make the player walk to the enemy position minus 2 units so the player is next to the enemy instead of IN the enemy.
Hope someone can help.