I’m coming from Director, so I’m trying to learn the workflow for Unity, and I’m wondering about how you would go about locating a specific gameobject for the camera to follow.
I have several gameobjects using a custom built movement/physics script. I have public static variables set up for the X, Y, and Z of the gameobject. I can pull these variables into the camera’s script in order to figure out where the camera should move to.
float WhereToGoX = CharMoveScript.MyX;
So I pass this into my camera script, but the issue is that it’s going to pulled it from every CharMoveScript C# script that’s running. I want to be able to differentiate between those scripts so I’m only pulling variables from one of them.
Or maybe I’m just going about it the complete wrong way. That’s possible, because again, I’m learning the Unity3D workflow from what I’m used to in Director. What would be the best way to have my camera script locate a specific object (by name?) to figure out where we’re moving to?