|
hi there, this is tom again. after finishing my last project with some helpfull hints from the folks out here, I started a new project with new problems. I build a little plaza and a seeker drone should move between some points. for that I use the "SeekSteer" script from the unity Wiki pages. it works very fine when I use a drone in normal way. the script defines the destination points in an array in form of JAVASCRIPT "var waypoints : Transform[]". when I change the seeker object to a prefab, then it looses all the preset waypoints and i cant set them. do anybody has experience with that script or can tell me how to define the waypopints within the script in an form like: waypoint[0] = Transform p1, waypoint[1] = Transform p2, waypoint[2] = Transform p3, ... thx a lot from berlin tom
(comments are locked)
|
|
To build a list of those object's transforms at runtime, you could use something like this (if you know the number of waypoints in advance):
Notes:
If you have numerous scenes or situtaions where the number of waypoints might vary, you could modify this code to dynamically discover the number of waypoint objects first, before building the array. That way you wouldn't have to have a hard-coded number in your script which determines the number of waypoints.
(comments are locked)
|
|
Plae new java script send me my Email iD
(comments are locked)
|

What are "p1", "p2" and "p3"? are they the names of GameObjects?
hi duck. yes p1, p2 ... are the names of the GameObjects. this are emty objects
one more time lots of thanks duck. nest time we have a beer...
no problem :) if it solved your question, please click the 'accept' button.