- Home /
Increase speed of an object's fall
I'm developing a simple 2D game to learn Unity.
It's very simple, when you run the game a cube at the top of the screen falls, that's all.
What I'm trying to do is increase the speed the cube falls from the top of the screen. How can I do this?
UNITY:
CODE:
Answer by JVene · Aug 31, 2018 at 10:15 PM
By "fall" I assume you mean due to gravity (if that assumption is wrong, nothing I'm about to write will be applicable).
The unit of measure in Unity is the meter. A distance of 1.0 is 1 meter. In 'standard' gravity, Unity's default, if a 'unit cube' (a cube 1 meter on each side) falls, it is like a 1 meter box falling from a truck. It's slow.
If what you're expecting is a 1 inch cube, falling from maybe 12 inches from the surface of a table, but you're cube has the dimension of 1 one each side, it isn't a 1 inch cube falling quickly, it's a 1 meter cube falling slowly, and not from 12 inches, it's falling 12 meters. All objects fall, due to gravity on Earth, at the same rate of acceleration, so larger objects falling larger distances naturally 'seem' to be moving more slowly.
What you require is a corrected sense of scale. For a student who already created a game measuring in meters, but expecting inches or centimeters, the tendency is to want to increase gravity or time. You can do that, but now everything is scaled by either gravity and/or time, and not by a measurement that is relatively comprehensible thereafter. Your best option is to scale, or to fashion originally, your objects to sizes that make sense to the reality you're attempting to imitate. If you're dropping 3 inch objects, don't make them 3 meters, make them .0762 meters, and suddenly things will start to work at the speeds you expect.
Hi, maybe I was not clear enough so I edited my question.
From the two images I can see that this is a 1 meter object falling 4.348 meters due to gravity, so the answer I gave is accurate in that if the scale were altered so it was, say, a 1 inch cube falling 4.348 inches, the results would be much, much faster.
That said, you can either increase gravity, or increase time scale , or you can add a force, or you can set a velocity on the Rigidbody under certain conditions.
Your answer
Follow this Question
Related Questions
how to keep a "ship" over a platform or rigidbody? 0 Answers
Gravity and Grounding 2 Answers
Gravity and rotation control 0 Answers
Vector3 is always subject to serious stutter in Translation 0 Answers
How do you make swimming possible with this script? 0 Answers