I’m very new to Unity and I will say it is an amazing engine. But for some time now, I’ve had this dilemma of witch I have no idea how to fix or do, and that’s activating and GameObject to effect another. I have looked around and used codes like…
(For Java Scripts)
otherObject.GetComponent(NameOfScript).enabled = true;
But seem to get no were, if it is possible, could someone show me the right way to do these sorts of codes in a little script example.
My situation is this, this is on a main menu and there’s is a button and a camera. Lets say when I click the button (named “NewGame”), it goes to a new scene, but before that, I want a little animation of the camera(Named “Maincamera”) moving in. There’s already a script attached to the camera(script named “cameramove”) that when activated, plays the animation.
How would the script for the button look like if it activates the camera script.