- Home /
Scripting "physics"?
Hello. Using scripting, how can I create a swinging mechanic like this game (where the player is able to shoot out a hook at a 0/45/90 degree angle and swing back and forth a few times and then reel up the to hooks anchor)? The swinging is simple, so I dont think using hinge joints, actual physics etc. is necessary.It does not have to be realistic, I have tried messing with hinge joints and the movements have been kinda crazy.
Answer by Joshua · Feb 21, 2011 at 12:01 PM
From your question I am guessing you have zero experience with actual scripting? I'd advice you to learn for yourself, because people aren't going to write entire scripts for you. What you want is not that hard though, break it down simple:
shoot 'hook' at an angle, distance from hook to player is D, with a/d you can rotate the hook -45/45 degrees with a constant D and with w/s you can lower/increase D.
A good place to get started would be http://forum.unity3d.com/threads/34015-Newbie-guide-to-Unity-Javascript-%28long%29
And when you encounter concrete problems we'll be happy to help of course! :D