Im having trouble moving forward after rotating.

 if (Input.GetKeyDown(KeyCode.W)) {
            Vector3 position = transform.position;
            position.z++;
            transform.position = position;
            _charController.SimpleMove(position);
        }

        if (Input.GetKeyDown(KeyCode.S)) {
            Vector3 position = transform.position;
            position.z--;
            transform.position = position;
            _charController.SimpleMove(position);
        }

        if (Input.GetKeyDown(KeyCode.A)) {
            transform.Rotate(0,-90,0);
        }

        if (Input.GetKeyDown(KeyCode.D)) {
            transform.Rotate(0, 90, 0);
        }
    }

That’s the main part of the script. Can anyone see where I’m going wrong?[/code]

https://forum.unity3d.com/threads/using-code-tags-properly.143875/

well this is confused… you’re moving in this script and then telling the charactercontroller to move too…

you’re also doing world space alterations to the vector, so it doesn’t take into account the facing of the object.

Try looking into “transform.forward” etc.

i read that unless i use the character controller then my player will be able to walk through walls. So i used SimpleMove so the wall would detect the charcontroller component. I’m very sorry. I’m new to coding and am trying my best. Just giving people this notice.

@LeftyRighty thanks for the link too. I’ve used it since and now my code looks better for this topic.

I will try your suggestion later on as i’m finished coding for today. If anyone else would like to add anything to this topic that it might help please leave a post at the bottom. Thanks forum.

What’s your Hierarchy look like?

transform.forward did work for me. Thanks