Quantcast
Channel: Answers by "hoekkii"
Browsing all 26 articles
Browse latest View live

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 Article


Answer 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 Article


Answer 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 Article

Answer 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 Article

Answer 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 Article


Answer 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
Browsing all 26 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>