Hi all! I’m trying to create a waypoint system for my enemy without really setting up waypoints like most people do it. I’m trying to have it where I have an array of Vectors that the enemy will follow a path to. I’m also trying to visually display the waypoints as well, however when I change the vector numbers in the inspector, the gizmo does not move. Can someone tell me what I’m doing wrong? Is what I’m doing even going to work?
Thanks for any and all help!
var waypoints : Vector3[];
function OnDrawGizmosSelected (){
for(var patrol in waypoints){
Gizmos.color = Color.cyan;
Gizmos.DrawWireSphere(transform.position,1);
}
}
Your gizmo doesn’t draw the vector, your gizmo draws the position of the GameObject on which the component is attached that has the waypoint vectors stored in it.
I have a pretty good understanding of what variables and parameters are, I just need a little bit of help with this. And I already tried this solution before hand and it does not work. Thank you for your help and have a great day.
If you don’t know the syntax to change from passing ‘transform.position’ as a parameter to using the vector you’ve looped over. You don’t have a complete grasp on variables and parameters.
To say otherwise is to hold up your math quiz with an F on it and say you understand math. You failed the quiz, it has been demonstrated you do not.
I’m not trying to be mean here. I’m just stating the fact of the matter.
I said ‘pretty good’ understanding. Enough to get my enemy up and running. Never did I state I had a complete grasp. And you yourself gave me a solution that does not work and you tell me that I don’t have a complete grasp on the concept?
In any case, I’ve SOLVED it. Thank you for your help, and have a wonderful day.
sigh
Only if you forgive me for all that I’ve said…it turns out that it did worked. It just didn’t draw on top of the enemy like I thought it would, but in the center of the world. I guess we were both right…sorry dude…