How to set up controls for a RigidBody marble?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By OttoLulau

Hi guys, this is my first time using Godot, and I’m very excited.

I have the following problem, maybe you can help me:

I, as the player, want to control a Rigidbody marble/sphere by add_torque.
The camera is following the marble, and I know how to add torque from the Point of View of the Camera. (I used the code from the “Kinematic Character 3D” Demo… :slight_smile: )

I want the maximum rotational velocity to be capped, such that you cant accelerate on your own beyond a certain velocity. However, this should only count for the velocity added by the player’s Input.
So for example, if the marble rolls down a cliff, it should be able to gain more angular velocity than the maximum from the player’s Input.

How would I go about implementing this?

Relevant code: (this doesnt work well yet, though; just so you can get an idea)