- Home /
Reproducing the "spin" effect of Flick Kick Football
If you are into mobile games you probably played Flick Kick Football at least once; if you haven't here are the links https://itunes.apple.com/us/app/flick-kick-football/id376481969?mt=8 https://play.google.com/store/apps/details?id=com.pikpok.fks
Once you hit the ball with the finger, if you are quick enough, you can adjust the ball's trajectory with a swipe gesture. I've already implement the simple kicking mechanism with the AddForce method. I've already tried using the same AddForce method to reproduce the spin effect but the result is quite unrealistic. Do you have any suggestion for its implementation?
Here's my current Update method:
void Update ()
{
if (Input.touchCount == 1)
{
Touch touch = Input.GetTouch(0);
Ray ray = Camera.main.ScreenPointToRay(Input.GetTouch(0).position);
RaycastHit hit;
v3 = Input.GetTouch(0).deltaPosition * Input.GetTouch(0).deltaTime;
v3.Normalize();
if (Physics.Raycast(ray, out hit) && hit.transform == transform)
{
float positionDifference = Mathf.Abs(Input.GetTouch(0).deltaPosition.magnitude);
if (positionDifference > minimumDrag)
{
transform.rigidbody.AddForce(new Vector3(v3.x * 30.0f, v3.y * 30.0f, 26.0f) * flickForce);
}
}
}
}
Thank you very much :)
I've found simulating the $$anonymous$$agnus effect (the curve of a spinning ball) best done by adding a small amount of force every frame.
http://answers.unity3d.com/questions/377944/how-to-make-a-ball-rotate-as-per-its-moving-direct.html
The direction of the swipe gives you the axis of rotation (and therefore the direction of the curve), and the velocity of the swipe gives you the speed of the curve.
@lucamegh - you just edited your question (I assume to bring it back to the top of the queue). Did you try what I suggested?
Answer by Khalid-Mahmood · Jan 23, 2016 at 12:23 AM
http://answers.unity3d.com/questions/377944/how-to-make-a-ball-rotate-as-per-its-moving-direct.html @lucamegh
Your answer
Follow this Question
Related Questions
Detect swipe up gesture IOS 1 Answer
Make Swipe Detection Longer? 0 Answers
multi touch / swipe issues 5 Answers
Multiple Cars not working 1 Answer
How can I make my player air dash using velocity toward a target more consistent? 0 Answers