# Simulation a Frisbee throw - How to give the curve effect ?

Hello everyone,

I have begun Unity3D a few days ago, and the main idea for my first game was a “Frisbee throw game”.

I don’t know how to throw the frisbee and let it make a curve in the air.
If someone has an idea how to do it, it would be nice !

Here is the script I wrote for throwing the frisbee. It throws the frisbee when I put the left click (using addForce and putting isKinetic to false), and make it spin too (launching Rotate() in Update() until it touches something (the ground here) :

``````    using UnityEngine;
using System.Collections;

public class launchFrisbee : MonoBehaviour {

const int LEFTCLICK = 0;
const int RIGHTCLICK = 1;

public Vector3 _force;
private bool bIsThrown = false;
private bool bRotate = false;
private bool bTouchedTheGround = false;

public void OnDrawGizmos()
{
Debug.DrawLine(transform.position, transform.position + _force / Physics.gravity.magnitude, Color.red);
}

void Start () {
}

// Update is called once per frame
void Update () {
if (Input.GetMouseButtonDown (LEFTCLICK) && !bIsThrown) {
this.rigidbody.isKinematic = false;
bIsThrown = true;
bRotate = true;

}

if (bRotate && !bTouchedTheGround) {
Rotate();
}
}

void Rotate() {
this.rigidbody.transform.Rotate (Vector3.up, 2000f * Time.deltaTime);
}

void OnCollisionEnter(Collision collision) {
bTouchedTheGround = true;
}

}
``````

Thanks !

Assuming you built your Frizbee so that the top of it points up when the rotation is (0,0,0), you can do something like this:

``````void FixedUpdate () {
if (!bTouchedTheGround) {  // Curve force added each frame
Vector3 sideDir = Vector3.Cross(transform.up, rigidbody.velocity).normalized;