Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Direct change in body velocity with inverse relationship

Discussion in 'Physics' started by Paprikar, May 31, 2019.

  1. Paprikar

    Paprikar

    Joined:
    May 7, 2019
    Posts:
    2
    How is it better to implement functions for changing the speed of the body with an inverse relationship?

    I am writing functions to tweak the physics of movement of a character and have encountered some problems...

    Already have the necessary functions - GetInputs and InputManager. Everything works properly only when we are constantly working with the <axis>MoveInput variable, which is independent of the speed of the body (rigidbody.velocity). Later this value is applied to the actual speed of the character (here).

    A character can be affected by other objects, changing its speed, but not input variables that are needed to determine the correct behavior of its movement. I tried to operate directly with its speed, but this caused large delays in parameter changes (As in this branch). Using AddForce instead of direct speed change does not help.

    How can I fix this problem?

    P.S. Perhaps the post should be deleted, wrong section
     
    Last edited: Jun 1, 2019