How to make a single wheeled always erect 2D physics based vehicle?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By Anutrix
:warning: Old Version Published before Godot 3 was released.

I want to make a 1 wheeled 2D Vehicle. I started from here. But how to make body stand erect always above the wheel. In 3D, it can be imagined like like a box(body) with ball shaped socket on top of a ball that rolls. But I want it in 2D with physics. So far it is like this but body falls off to left or right:enter image description here
Here I made player(body)'s collision2D scaled half of sprite on y axis so it rests on circular wheel. It is like self balancing robot. Exactly something like with top half replaced by a square in 2D(mainly) and 3D game.
Is this the correct way to do this or is there a simpler way to do this?

:bust_in_silhouette: Reply From: Robster

I can’t really help as I don’t have the skills yet but I’ll be watching this as it looks like great fun. Best of luck with it.

:bust_in_silhouette: Reply From: eons

Character mode prevents rotation, but not sure if will work fine with that setup, the object may need to be more complex, with joints maybe and controlled by custom integrators.


If the game does not use complex physics, the wheel could be just a sprite rotating with the body speed, and the body a capsule in Character mode.

I do want complex physics

Anutrix | 2017-05-07 17:29