#How 2 Make Plr Move In Cam-Direction

1 messages · Page 1 of 1 (latest)

earnest sparrow
#

heya

#

so. i made a plr movement thingie

#

then. it only moves in a set direction.

#

after. i tried a handful of tutorials. all resulting in something finicky (reason is i reckon, its on a planet and the plr is rotated weird)

#

current movement:

#
    void FixedUpdate()
    {
        moveDir = new Vector3(
            Input.GetAxis("Horizontal"),
            0f,
            -Input.GetAxis("Vertical")
        ).normalized;

        rb.MovePosition(rb.position + transform.TransformDirection(moveDir) * speed * Time.deltaTime);
    }