I am working on a C# script for use with unity that will act as a gravity organizer (my term). For this I want the script to locate all objects that have a mass (a float that will assigned) and store their Mass, and coordinates (X,Y) in an array. I am not sure how I would go about identifying the Mass of each object and then storing the coordinates. I think that I would need two scripts, one for keeping track of all the masses, coordinates, and calculating the force of gravity, and then one for holding each object's mass and location.
Any help would be appreciated
↧