- Home /
Angry Birds Sling (3D)
Hello everyone!
Im trying to come up with a 3D clone of Angry Birds. The thing Im working on now is the sling. Could you please help me with how to make it work?
Im new to Unity, I used to work with Game Maker. In there it would be something like: motion_set(point_distance.sling, point_direction.sling) so that after I released the ball it flew in the set direction with the speed which depends on how far Ive dragged it backwards before shooting.
Any help will be much apreciated. Ideally you could give me a link to a related tutorial or at least suggest where I should dig. Thanks.
This question has been answered in various forms before. The latest version I think was launching squirrels. Given that you have the world position of the aim point and the object about to be launched, the calculation is:
rigidbody.velocity = (transform.position - aim.position) * factor;
Factor will you need to deter$$anonymous$$e by trial and error with your game. Note all the heavy lifting with this problem is associates with mapping the 2D mouse/finger coordinates into 3D world coordinates. Lots of answers for this kind of mapping, but the solution will depend on your game mechanics.
Your answer