Need help with assigning new forward transform position

I’m trying to use position of mouse x to change my players forward axis so that Up arrow still moves up as the rotation is changed with mouse x

or

using mouse x to rotate camera and the players forward position is aligned with camera view.
not sure how to do this.

using UnityEngine;
using UnityEngine.UI;
using System.Collections;

public class PlayerMovement : MonoBehaviour {

    Animator anim;
    Rigidbody rb;
    Vector3 hitr;
    Vector3 hitrn;


    float speed = 150f;


    void Start()
    {
        rb = GetComponent<Rigidbody> ();
        anim = GetComponent<Animator> ();
    }

    void Update ()
    {
        Move ();
        Turning ();
    }

    void FixedUpdate()
    {
        //inclines
        RaycastHit hit;
        Physics.Raycast (transform.position, Vector3.down, out hit);
        if(Physics.Raycast(transform.position, Vector3.down, .5f))
        {
            transform.up = hit.normal;
            hitrn = hitr - transform.eulerAngles;
            transform.Rotate(hitrn.x, 0, hitrn.z);
        }
    }


    void Move()
    {
        float forward = Input.GetAxis ("Vertical");
        anim.SetFloat ("Speed", forward);
        float sideways = Input.GetAxis ("Horizontal");
        anim.SetFloat ("Direction", sideways);

        Vector3 movement = new Vector3 (sideways, 0f, forward);
        rb.AddForce (movement * speed);
    }

    void Turning()
    {
        if (Input.GetAxis ("Mouse x"))
        {

        }
    }

}

@ZGMGames

Hi there, not sure what exactly you are aiming at, but you have both forward and sideways set to read your Horizontal axis… which isn’t most likely what you want.

Anyway, if you want to make player rotate by using horizontal axis (mouse horizontal movement converted to rotation of your character), and moved forward / backwards using vertical axis, then you can use player’s transform.forward for player relative movement axis, which are not aligned to world xyz at this point.

Yeah I was messing around typed wrong axis. I actually have it in vertical. See, I have a animation set for horizontal that makes my player walk to the side still facing forward. What I’m wanting is to rotate his forward axis using the mouse position x to set his rotation so that he can still walk sideways without rotating until the mouse position is moved. So my vertical and horizontal are just positions I need while mouse x would be rotation.