- Home /
Translating measurement in rotation speed and game object size to non-technical staff
I have questions I would like to know regarding unit size in Unity 3D to human measurement unit. Here as follows:
My boss wants me to translate the size of the GameObject in cm, inches, or meters. I find it impossible yet and the only thing I could do for programmers like me is size relative to the screen regardless of the resolution and DPI. Also, there is another case that there is a large GameObject with the transform scale is 1 and the small GameObject ones but with the scale of 1 too. What should I do? I am revising the game stage editor that I've created in scene file so that when my boss checks my edited level and he needs to ensure the exact measurement without guessing since I usually do "duct tape" some quick fixes and adjusting size by uncertain numbers like the size of the object is 1.25f. The closest possible something is...let's say, "Sir, the size of that object thing is 1/3 of the screen," or something. But, I'm looking for other possibilities to make the reference of the measurement easier.
Also, next, my boss asked me for a specific speed of rotation of a big dot in Z-axis. Taking measurement on how fast the rotation is via RPM. I took some research for this code (or should I say "the formula?") as I shown in below from Unity forums website to check for update changes of the big dot's rotation speed. I revised it according to my preferences and put it onto OnGUI() for updates everytime. But the result is zero (I simply get from the RigidBody 2D of this bigdot but instead I get the GameObject of this body instead) but the rotation is on going while playing. Did I made mistake or something? If yes, what would be the cause? Aside from zero RPM issues, I check the value of the current and previous degree and I found out they both have the same values instead where my expectation is that whatever the order of the code and must be appeared as different values..
Here's the code I've made from question #2:
// Get the game object of the 2D rigid body.
GameObject round = body.gameObject;
// Get the current degree.
currentDegree = round.transform.eulerAngles;
// Compute the RPM.
float degreePerSecond = Mathf.Abs (currentDegree.z - previousDegree.z);
// Obtain the RPM and update previous degree vector. (Euler Angle)
float rpm = 0.166666666667f * degreePerSecond;
previousDegree = currentDegree;
// Display result.
status.text = "RPM: " + rpm; // --> Still 0 RPM while still moving.
// Before run, the status would be "RPM: ? ? ?"
// When running, the status is still "RPM: 0" even if it's spinning.