- Home /
Question by
Tyler Starr 7 · Apr 16, 2011 at 04:12 AM ·
iphonehitswing
swing to hit a target
Hi. I need a AI system that locates an Target. Then it needs to swing at the target (maybe using a joint to swing or something). How can this be achieved? All help is Appreciated.
-Tyler
Comment
Answer by Ashkan_gc · Apr 16, 2011 at 05:15 AM
you can use Vector3.Slerp easily without using any physics or so. you should use a coroutine to move the object in time toward what you want on an arc. if you need real swinging with going forward/backward multiple times then you need physics and joints.
sorry but currently i don't have time to describe more cause i should go to university.
the slerp method takes a Vector3 as the target that you want to move toward.