|
I have a curved ground (model) in my scene working as a hill race track. I have added several cylinders and applied rigid bodies to make them move (roll) down the track. What is the best way to get the cylinders to move the way I want them to move? As it is right now, the cylinders are moving to slow. I want them to speed up when moving down the hill. How can I achieve this? My solution right now:
(comments are locked)
|
|
I like rockets! (ConstantForce) Woosh! Just make sure to angle them correctly so as to not shoot your barrels off into space. :) Link --> ConstantForce That seems more like a workaround than a solution (and in any case, it doesn't really correlate with the behavior the OP described).
Jan 12 '11 at 08:34 PM
Jesse Anders
This might work well. I used rigidbody.AddTorque(0, 0, 100 * direction); in the Start function but your solution is even better.
Jan 12 '11 at 08:37 PM
Mattias Wargren
@Jesse Anders Could you please explain?
Jan 12 '11 at 08:38 PM
Mattias Wargren
The impression I got was that you wanted the cylinders to roll down the hill due to gravity in a realistic fashion, in which case applying a linear force (or even a torque) would be a bit of a workaround. But, if it looks right to you and gives you the results you're after, that's probably all that matters.
Jan 12 '11 at 08:47 PM
Jesse Anders
Constant forces are pretty easy to do if you want to try it out to see if it does what you want. Select your barrel in the Scene View then all a constant force to it via Component/Physics/ConstantForce. Then just fiddle with the variables to see if it'll do what you want. Have fun. :)
Jan 12 '11 at 08:49 PM
Goody!
(comments are locked)
|
|
This may be too obvious, but have you tried playing around with different physics materials? (Also, make sure the masses of your objects are in proportion to the scale of the scene and your gravity settings.)
(comments are locked)
|
|
Aside from scale, one cause of too-slow rolling is not having a high enough max angular velocity in the physics settings. What is a good value for max angualr velocity and what are the consequences of altering the value?
Jan 12 '11 at 08:41 PM
Mattias Wargren
Jan 12 '11 at 09:12 PM
Eric5h5
Just try things out. Save your project under a different name if you are worried about messing it up, and try things. Make a new barrel with super low angular velocity and see what happens, attach a constant velocity to another and see what happens, hell, set off an explosion next to one and see if it does what you want. Most of the stuff mentioned in the answers don't have anything to do with scripting and are pretty much, plug, play, and experiment. :)
Jan 15 '11 at 11:39 PM
Goody!
(comments are locked)
|

