Hi guys!
If you have seen my previous questions I’m sure you know I’m making Fruit Ninja clone. Now the problem is I feel the objects to be slashed are moving too slow that it is very easy to slash them all without any miss.
This is the snippet on how I work on making the objects “fly”
angle = Vector3(0, 0, Random.Range(7, 0)); //Determine the angle
direction = Quaternion.Euler(angle) * transform.up; //Determine the direction
boxes.rigidbody.AddForce(direction * foodSpeed);
“angle” is to apply “arc” to the object’s movement, “direction” is to make the object “fly”, “foodSpeed” is to determine the power, how high I want the object to fly.
What have I done so far are:
- Changing the gravity setting in Unity (default is Y: -9.8) but this will just make it “heavy”, it didn’t affect the speed at all
- Played around with the Rigidbody properties (drag, angular drag, mass, interpolate) but seemed didn’t change anything
- Adjusting the foodSpeed didn’t change anything, it just affected how high the object flew
- Increased the time scale setting to 1.25 but it will ruin my game timer because the game is 60 seconds duration. So when I show the game timer on the screen, it ticks faster than normal time obviously
I have looked for solutions but no avail. I appreciate any tips and advice, thank you in advance =)
Well, you could access the rigidbody velocity and change that to what you want and whenever you want. You can also check its Y velocity to check when it is traveling upwards and downwards. And depending on its stage you can apply different things to it. For instance when it slows down at its apex bump up the mass a lot and lower the drag so that it drops down very quickly.
– Default117Awesome! Glad it worked out in the end
– Default117