Basically, I'd like to replicate what set_axis_velocity() does in 2d, but instead of just affecting linear velocity, I'd like to affect both angular and linear velocity, by essentially changing the velocity not along the center of mass, but offset, like you would do with apply_impulse(impulse, offset).

Thanks in advance!

  • xyz replied to this.

    xyz Not quite what i'm looking for. I'm trying to directly set the linear velocity at a specific offset point.

    • xyz replied to this.

      xyz I'm trying to do set_axis_velocity() but offset from the center of mass

      • xyz replied to this.

        xyz Basically just setting both angular and linear velocity at the same time, just like you would apply both torque and force with apply_impulse().

        • xyz replied to this.

          AntoninStern Then use apply_impulse(). The velocities of rigid bodies are not really meant to be tampered with directly. They are a result of the simulation rather than its input parameters. The input parameters are forces and impulses. If you want to control velocities directly use a kinematic body.

            xyz Ah but using apply_impulse() behaves extremely weirdly. it's spinning all over the place and just outright behaving very weirdly.

            • xyz replied to this.

              AntoninStern I guess that'd depend on how you actually use it. We'll need to see some actual code that causes that weird behavior.