Hello, I’m a newbie in unity scripting, but I am trying to do something like this:
I have an object in Script 1, which is randomly generated within specific area. I have a Script 2, which generates movement from one waypoint to second, third… etc. But I have also second script, which I want to use to add a waypoint basing on this object location. I want to pass this waypoint (which is changing together with object position) to second script, which will cause move of this moving object to this new waypoint (instead of old ones).
So in short:
Script 1:
GameObject object;
public bool isReady = false;
Use log statements, debuggers, etc. to figure out where your program is going off the rails and resolve it.
The first place to start though would be a betteer description of “It’s not working”. That is not really an actionable statement. What’s not working? The code isn’t compiling? There’s an error? The behavior is incorrect?
Expect to see this error a LOT. It’s easily the most common thing to do when working. Learn how to fix it rapidly. It’s easy. See the above link for more tips.