Quantcast
Channel: Answers by "doomprodigy"
Viewing all articles
Browse latest Browse all 90

Answer by doomprodigy

$
0
0
What you want to use for a easy method is just a if (Vector3.Distance(other.position, transform.position) < tooClose){ moveSpeed = 0; } That way once the AI's distance between the player and the AI is less than the tooClose variable you cut the move speed to 0, then just simply add another distance script asking if the distance between the player and the AI is greater than tooClose and make the moveSpeed variable = 3 (or whatever your movespeed was). This is essentially what you are doing there but you are just not cutting of the moveSpeed variable to 0 and then once you are greater than you tooClose variable putting it back to normal.

Viewing all articles
Browse latest Browse all 90

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>