Search Unity

  1. Unity 2019.2 is now released.
    Dismiss Notice

[SOLVED] Snappy physics

Discussion in 'Physics' started by DrDoofenshmirtz, May 13, 2019.

  1. DrDoofenshmirtz

    DrDoofenshmirtz

    Joined:
    Aug 23, 2018
    Posts:
    3
    Hi everyone.

    I really hope someone can help me. I have thought about writing here for a long time.

    I am currently creating a game where I have multiple character being controlled by multiple players.
    The game is about pushing each other with projectile abilities. When a character is hit, it will be pushed back using physics to apply an Impulse force.
    I also want to be able to move the character around of course, and since moving a game object around using the transform is bad practice, I am trying to make it work using the Rigidbody.

    The problem with the Rigidbody is that the only way, as far as I know, that I can move it around without setting the velocity directly, is by applying a Force, which will make it accelerate. I want it to be instant. The character has a movement speed, and this speed should be immediate without acceleration.
    I also want the characters to be able to push each other a little bit by moving into each other. And lastly, the projectiles and abilities themselves does not use the same kind of physics. They simply detect collision and then I apply an Impulse force myself.

    So all in all:
    1. Responsive movement
    2. Push when moving
    3. Forces applied in scripts

    I hope everything makes sense and that the problem is clear. Basically I am not able to have snappy, responsive movement while also being able to apply forces with scripts.

    Please enlighten me.

    Matt
     
  2. DrDoofenshmirtz

    DrDoofenshmirtz

    Joined:
    Aug 23, 2018
    Posts:
    3
    Okay, so after all this time, I literally just searched for it AGAIN on YouTube and a new video was up.
    The solution is to use Rigidbody.MovePosition(). Using this I get everything I want.