Answer by hoekkii
Create a C# script, copy and paste this (Make sure class name and script name are the same, so replace h_BalloonController to the script name) and attach it to your balloon. change mass and gravity...
View ArticleAnswer by hoekkii
I guess something like this, I would not recommend this structure. Maybe use a tween library or create your own, for easier aborting and stuff. Note I did not test this, but it should work. static bool...
View ArticleAnswer by hoekkii
Reflection does not care about function overloading. Instead use `Type::GetMethods : MethodInfo[]` instead and make a function like this: public static void SafeInvoke(this MethodInfo[] methods, object...
View ArticleAnswer by hoekkii
Readability is most of the time more important than efficiency, but first of all some feedback on your code:You should initialize objects inside `Awake`.Why don't you remove items from the list? This...
View ArticleAnswer by hoekkii
Personally I would go for a different approach, since the speed to angle conversion is not linear. But first of all some suggestions:Try avoid duplicate code `PIN.transform.localEulerAngles = new...
View ArticleAnswer by hoekkii
Short answer: public static void Normal2PitchYaw(Vector3 normal, out float pitch, out float yaw) { yaw = -Mathf.Asin(normal.x) * Mathf.Rad2Deg; pitch = Mathf.Atan2(normal.z, normal.y) * Mathf.Rad2Deg;...
View Article