Im currently working on revamping my movement system in my game. My game uses a custom character system, and does not utilize roblox’s character scripts. In the past, the way I’ve done this is simply by adding a directional vector to the player’s velocity. The problem with this method is that the player will always maintain that constant velocity.
This creates results like the player dragging down walls when they run into them, the player being mostly unaffected by other objects colliding with them, etc. In general, when the player runs into a wall, you’d expect them to stop and fall to the ground. When they player is struck by a large object, you’d expect them to go flying.
What is the best way to go about doing this? I feel like I might be overcomplicating things a little, but I’m at a bit of a loss.
Just check for any objects that collide with them and increase the force dependant on how big the object is
Ideally I’d like the character to behave the same way a static object would. If a part is slammed into by another part, that part will go flying in a way that Roblox physics already dictates. If I dont give my character any movement mechanics at all, it will behave this way. Ideally I dont want to alter this behavior in this scenario whatsoever, but still have by character be able to move around. I dont mind reinventing Roblox physics inside my code if there is no other way, but I’d like to rely on the prexisting physics engine as much as possible.
I like to use BodyVelocity as movement for my movement systems such as dashing.
I do understand the problems that you are experiencing in your post and this is something I would hope to avoid when dealing with movement. Most of my movement bugs happen with LinearVelocity. I’m unsure if it’s because I’m doing something wrong, but when I switched to the deprecated BodyVelocity, everything that was an issue before seemed to have vanished.