- Home /
change an object's velocity, while you edit its transform as well?
I am trying to find a way to move characters very accurately (by directly editing their positions over time) while retaining the ability to knock the character around.
Using the physics engine would not let my position the character accurately enough, but I do not know of a way to mimic the physics of sending a character flying, and letting the character continue to use input to stop itself, without losing the accuracy of directly changing its transform.
Now, by no means am I trying to create Super Smash Bros., but I would love to know how everything moves in it. It doesn't seem like the running and walking is like AddForce, or changing the velocity, but when the characters are hit they go flying, and input can counteract that... so it seems like they use force.
I am confused!
In summary, I am trying to ask this: https://www.reddit.com/r/gamedev/comments/5qhb55/character_movement_based_on_physics/ except I want to know how to use both lerping transforms and velocity increases and maybe an add force all on the same character. Whatever it takes!
Answer by Cornelis-de-Jager · Apr 12, 2018 at 05:15 AM
You want to move it via the RigidBody.MovePosition. This takes the current Physics applied to the object into account.
Read More here:
I haven't fully tested it out, but this is a lot like what I was looking for, so thanks!