#unity3d
I had the sudden urge to make a missile in Unity, but to spice it up I thought it would be cool to make a PID controller. Also, it would be a pretty boring Unity tutorial if it was just about a missile moving toward a target now wouldn’t it? Even though that is exactly what it is.
Anyway, I did some research and found this really great post (https://forum.unity.com/threads/rigid...) on the Unity forums by Brian Stone, who does a really great job of explaining how PID controllers work, and even provides and awesome example project which makes use of a spaceship.
I adapted Brians code to work in 3 dimensions, and applied it to this missile that I modelled in blender, I think it works pretty well, a part from the random axis issues I’ve been having, but I’m sure I’ll be able to sort that out in the future.
If you’re interested you can find the code in the git repo here: https://github.com/Tvtig/UnityPIDCont...
Become my first Patreon: https://www.patreon.com/tvtig?fan_lan...