Hello folks, how are you doing?
I succeeded in making a falling objects from the top of the screen, but what I need now is making that falling gradual; I mean let the objects fall slowly at the beginning and then making them falling faster and faster…
anyone have an idea?
You need acceleration, which is the change in speed over time. I recommend making a “speed” variable, then each update you should increase the speed variable and use that variable to control how fast your objects fall. Something like this:
float speed = 0;
void Update()
{
speed = speed + 0.2f * Time.deltaTime;
transform.position += Vector3.down * speed * Time.deltaTime;
}
(In this example, “0.2f” is how fast you are accelerating)
You could also consider adding a rigidbody component to your objects, and activate gravity for those. Those object will then have gravity / other physics calculations applied to them. Gravity acceleration is 9.81 m/s per default, you can change this value under Edit > Project Settings > Physics.
If you decide to do so, you’ll probably need to deactivate your current method of moving the objects as it might interfere with the physics calculations from the engine.