Performance Issues

HomeForumsA* Pathfinding ProjectSupportPerformance Issues

Tagged: 

This topic has 2 voices, contains 18 replies, and was last updated by  Aron Granberg 104 days ago.

Viewing 4 posts - 16 through 19 (of 19 total)
Author Posts
Author Posts
February 4, 2012 at 02:16 #1410

Travis

Actually the code in the example scene is correct. If we’re talking about the call SimpleMove in AIFollow. That was already in the Update function, not FixedUpdate. Did you just type it out wrong in the tutorial?

February 4, 2012 at 07:53 #1413

Aron Granberg

Yup, only in the tutorial.

February 4, 2012 at 23:15 #1417

David Tredeau

I added this code to the AIfollow script in order to have it randomly choose a final destination.
public Transform[] target = new Transform[10];
public int waypoint;
After adding this code I got these errors.

`UnityEngine.Transform[]‘ does not contain a definition for `position’ and no extension method `position’ of type `UnityEngine.Transform[]‘ could be found (are you missing a using directive or an assembly reference?)

The best overloaded method match for `Seeker.StartPath(UnityEngine.Vector3, UnityEngine.Vector3, OnPathDelegate)’ has some invalid arguments

`#2′ cannot convert `object’ expression to type `UnityEngine.Vector3′

February 4, 2012 at 23:19 #1418

Aron Granberg

Transform[] is an array not a single Transform object. An array does not contain a “position” variable.
You will have to change so it picks a target transform, i.e calculate a randomized index so you can access it like target[4].position, which will give you the 5th target transform.

Viewing 4 posts - 16 through 19 (of 19 total)
Reply To: Performance Issues
Your information:






<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>