I want to apply wind effect like paper toss in my game.
It should appear one of the side right or left and the paper i swipe should go in curved path according to value of wind.
How can i do this ?
Thanks.
I want to apply wind effect like paper toss in my game.
It should appear one of the side right or left and the paper i swipe should go in curved path according to value of wind.
How can i do this ?
Thanks.
That’s actually an extremely complicated effect to simulate with physics. A sheet of paper doesn’t just move in one direction. Different forces and resistance cause it to move in several directions. You could simulate it with rigidbodies using joints and multiple forces.
It might be easier and more efficient to use a hand-animated effect instead of physics simulation. Especially if you’re developing for mobile, the physics would be too heavy.
Finally i have written one small script & applied to the paper.
var object : GameObject;
function Start(){
object = GameObject.FindGameObjectWithTag("Paper");
}
function Update () {
if(object .transform.position.z > -4){
// change appropriate value of force according to wind value
enemy.rigidbody.AddForce(Random.Range(5,20),0,0);
}
}