How on earth does Linear Dampening work (if at all)?

From what I've gleamed from elsewhere, Linear Dampening basically reduces the velocity by the fraction represented by the value.
Problem is, I can't seem to get the feature to work, as even if I set Linear Dampening to 1 (Supposed to be an instant stop), the Rigidbody I'm manipulating does not decelerate at all. Even more worryingly, if Linear Dampening is less than one, I have actually seen the Rigidbody accelerate in a manner proportional to the body's current velocity.
Problem experienced in Godot v3.2.1 - stable_mono_win64 while programming in Godotscript.


Tags :

Best Answer

Answers

  • TwistedTwiglegTwistedTwigleg Posts: 2,629Admin

    Welcome to the forums @Stormageddon01!

    Can you post a snippet of the code that performs the linear dampening? Or are you using the built-in dampening with the RigidBody node?

    Based on the description of the issue, it sounds like the linear dampening has the values in the wrong order, or the dampening is being added to the velocity/acceleration rather than directly modifying it. That said, I'm just guessing.

  • Stormageddon01Stormageddon01 Posts: 3Member

    Actually, I managed to fix the code-for a while. I was using apply_central force, which is apparently not supposed to be used every frame.
    Here's my new issue though: apply_central_impulse seems to have randomly broken when adding an unrelated piece of code: "poll_mouse_inputs" broke something it seems.
    Code part 1:

    Code part 2:

    Player Scene

  • Stormageddon01Stormageddon01 Posts: 3Member
    Accepted Answer

    This appears to be a bug with the mono version. (BUG)

Leave a Comment

BoldItalicStrikethroughOrdered listUnordered list
Emoji
Image
Align leftAlign centerAlign rightToggle HTML viewToggle full pageToggle lights
Drop image/file