I am trying to throw a gameobject on swipe direction similar to paper toss game
i tried Addforce but i cant throw at swipe direction please suggest any solution.
bottom line : i want to throw object at enemy by swiping.
please help me through
if(Input.GetMouseButtonDown(0))
{
initPos = Input.mousePosition;
}
if(Input.GetMouseButtonUp(0))
{
finalPos = Input.mousePosition;
finalPos = Camera.main.ScreenToWorldPoint(finalPos);
rigidbodyBox = ball.AddComponent("Rigidbody") as Rigidbody;
rigidbodyBox.mass = 5;
ball.rigidbody.AddForce(???????)//what should i pass here //******
}
↧