Tuesday, November 27, 2012

Getting High

The last week hasn't been very productive due to me spending most of it in Austria on a school trip. Anyway, we got flying robots now, as the propellers are readily scripted.

Again I realized that physics as they would work and physics that feel right when playing can be far from each other. The aircraft in the video would (and did in the first tries) actually turn over and fall down in the air, because two propellers pull up the back part faster than only one in the front does.

Quick and dirty solution would have been to always apply the force the propeller adds to the center of the vehicle. But that would have been too easy, since it doesn't allow for propellers facing sideways to turn the robot while flying - the force needs to be applied at the position of the propeller (Unity: Rigidbody.AddForceAtPosition()) So I finally spent some extra time writing a script that balances the robot to always stay horizontal, similar to a Star-Wars-hovercraft.

No comments:

Post a Comment