Im creating a Hunter Game where you must Hunt Wolves. So i need 2 Script that the Wolves following me and if near enough, they Attack then.
I already tried myself but failed.
Im creating a Hunter Game where you must Hunt Wolves. So i need 2 Script that the Wolves following me and if near enough, they Attack then.
I already tried myself but failed.
If you dont want to write a bunch of code use
HuntWolve.position = Vector3.Lerp(HuntWolve.position, Player.position, Time.deltaTime * WolveSpeed);
for the Wolves to follow you. If you want them to avoid objects or something like this, its gonna be tricky. for the part with the attacking you could use something like
if(Vector3.Distance(HuntWolve.position, Player.position) < 10)
{
//Do attacking stuff
}
you can adjust at wich distance the wolves begin to attack if you change the number.
I hope i helped you ![]()