After a tons of changes to my code, I noticed that my code for side stepping stopped working but ignored it for a long time thinking it’s just something I could easily fix. But upon investigating it today, I have no clue what it wrong with it. Here’s my current code:
rb.AddForce(transform.right * moveVec.x * (moveSpd * sidestepDampening) * Time.deltaTime, ForceMode.Impulse);
I guess the only other notable changes I made from when this code was working was change the RigibBody
’s mass to 10 and changed my floor’s material that have dynamic friction = 0.27 and static friction = 0.19. Move forward works fine, which have almost the same code as this one, making me more confused. I tweaked the RigidBody material thinking it was the cause of this, but didn’t really fix the problem.
Here’s my speeds, I don’t have code to change to run speed when side stepping so only walk speed is used. But even when multiplying the speed to 100, it still didn’t move
UPDATE:
I forgot to mention that moveVec is the Vector3
you get from PlayerInput
so it won’t be null or zero when I try to move to the side. moveSpd
, in this case which is side step, would be equal to walkSpd
, so that’s can’t be zero or null as well. I’m thinking maybe this might be some RigidBody
mechanism issue that I don’t know about.