Tracking finger to throw objects
Hi to you all,
I would like to know if it is possible to throw object using finger tracking?
To illustrate what I ask, Flickkick football and paper toss apps are some good examples.
Of course, as these games are in 3D, I would like to know if we could do the same on a 2D plane.
I think it consists in tracking finger coordinates and ask gamesalad to make an actor follow the same angle and direction but Im a bit lost. I would like to reproduce angle and direction, with a velocity depending on the finger speed.
Any tips or comments about it would be welcome![:) :)](http://forums.gamesalad.com/plugins/emojiextender/emoji/twitter/smile.png)
Thanks!
I would like to know if it is possible to throw object using finger tracking?
To illustrate what I ask, Flickkick football and paper toss apps are some good examples.
Of course, as these games are in 3D, I would like to know if we could do the same on a 2D plane.
I think it consists in tracking finger coordinates and ask gamesalad to make an actor follow the same angle and direction but Im a bit lost. I would like to reproduce angle and direction, with a velocity depending on the finger speed.
Any tips or comments about it would be welcome
![:) :)](http://forums.gamesalad.com/plugins/emojiextender/emoji/twitter/smile.png)
Thanks!
Best Answers
-
RThurman Posts: 2,881
The curve comes from gravity (or from acceleration downward).
The 3D effect comes from slightly shrinking the actor's size as it travels. (Things that grow smaller seem to be traveling away from the eye.) -
RThurman Posts: 2,881
Instead of gravity use the 'Accelerate' behavior. Accelerate the actor downward (270) and it will simulate gravity. ( Accelerate is a persistent behavior and will continue to apply a downward force on the actor there after.)
Use the 'Change Velocity' behavior to kick the actor up in the air. (Change velocity is an action and only happens for the moment that it's turned on.)
-
RThurman Posts: 2,881
Glad its working for you. (Glad that there are great developers like @tshirtbooth who are generous with their projects/demos.)
Answers
I figured out how to build up the throw angle attribute
(The user can touch and create is angle between the touch and release point anywhere on screen)
Angle: VectorToAngle(ReleasePointX-TouchPointX,ReleasePointY-TouchPointY)
Strength: Magnitude(ReleasePointX-TouchPointX,ReleasePointY-TouchPointY)
Now I need to figure out how to make a behavior that will reproduce a curved finger swipe.
I found some template but I can't download so I need to get textual information.
Is there anybody who could help me find a way to do that? Please
Thanks
I finally found out a tutorial which explains how to draw a path a makes an actor follows it.
Added to the Angle and strength attributes I previously created, It make something closer to what I need (without angle and strength, the actor just stop where the mouse stopped too)
Once more, If you have anything to help I would be so happy haha I remain far from the curved swipe effect that we could find on flickkick football.
PS: Im writing all of this down so others could eventually use it.
My problem with gravity is that my actor is at the center of my plan's height. I could make a rule reversing the gravity with angles but how to fix my actor so it doesn't fall with gravity?
http://forums.gamesalad.com/discussion/41961/-free-demos-from-tshirtbooth-happy-easter-#latest
Study project 2.
thanks a lot