let rigidbody idle around in space
hey! i am working on a low gravity game: http://pixelpizza.de/wordpress/?p=606
and what i want to do is, that my rigidbody chracter is "ideling" a little bit around. so that means that he pushes himself up (addforce) when he is moving down, and back down when he is moving upwards. the same for left and right. in the end he should always try to push himself back to his start position or a specific point. so that it somehow looks like natural floating around in space. how would you do that?
it is extremely hard to do this. Look for scripts on the asset store / etc which simulate "bobbing" motion in water. you could easily have a $$anonymous$$m of three or four top-flight mathematicians and engineers work on this for three months. you won't find a trivial solution (unless it is crap)
Answer by Fattie · Dec 17, 2015 at 06:19 PM
For this difficult problem, the simplest reasonable solution is,
1) attach one of Unity's natty
spring
solutions2) write a script to VERY gently
force
the object in random directions at (probably) about 2hz
Note that when you see this done in say a PIxar movie, it is very much animated, not simulated. So, literally one of the half-dozen best animators on Earth will sit there for a few days and animate an "idle bobble" for the object in question. For buoancy in water, you can simulate it with math but it's usually not very good.
I hope the simple solution using Unity's handy spring, works for you.
Hey! Thanks! Gonna try that :) Just to understand: you mean spring joints?
Your answer
Follow this Question
Related Questions
Rigidbody.AddForce seems not to do anything 0 Answers
Rigidbody doesn't seem to apply gravity 1 Answer
rigidbody,addforce is affecting all clones which are clicked on through raycast 0 Answers
How to properly move a rigidbody character? 0 Answers
Copy collision object position (Or just "fly" a little bit) 0 Answers