Hi, I’m new to both C# and Unity.
I have the following line of code that doesn’t show any errors, but is also not working:
orbitalVelocity = GameObject.Find("Earth").GetComponent<SetInitialOrbitalVelocity>().initialVelocity + orbitalVelocity
I am trying to obtain the ‘‘OrbitalVelocity’’ from the script attached to the game object “Earth” and add it to the current “OrbitalVelocity” of the object that my new script will be attached to.
Any help will be much appreciated!