- Home /
Question by
IKDev · Aug 31, 2020 at 11:16 AM ·
c#rigidbody.moveposition
rb.MovePosition not working
Hi, so I am making a platformer controller from scratch (to put it in place of 281 lines long one). I am using this line of code to move the player horizontally, but I get questionable results:
rb.MovePosition(rb.position + new Vector2(Input.GetAxis("Horizontal"), 0) * speed * Time.deltaTime);
Idk is this because I am doing that in Update because I tried in FixedUpdate too and changing Time.deltaTime to Time.fixedDeltaTime. Nothing worked.
P.S What I mean when I say questionable results is that player moves horizontally like normal but falls very, very slow. And rb.AddForce doesn't work too.
Comment