Problem with Character Controller!

I have a big issue with this part of Code:

// Controlling
       // The Input.GetKey is only for testing!
        if (Input.GetKey(KeyCode.B))
        {

            Vector3 dir = transform.TransformDirection(Vector3.forward).normalized * calculateCurrSpeed();
            //dir = transform.TransformDirection(dir);
            //dir.y -= getFallConstant();
            Debug.Log("Direction " + dir);
            Debug.DrawRay(transform.position, dir, Color.red);
            if(Input.GetKey(KeyCode.V))
                characterController.Move(dir * Time.deltaTime);
        }

So take a look at the Problem:

The red line show the Direction of the Vector “dir” but it move’s in the direction of the Blue one? And always only along the x Axis, also if i Rotate the Object!

2059866--134152--Problem.JPG

i dont see a problem, does it do the same when you use transform.forward in Move() ?

1 Like

Yes it is the same… I Don’t know where the Problem is -_-

What i do wrong?!

are any invisible colliders or a nested hierarchy for the character?

No there aren’t any invisible Colliders, i blevie? How i can find invisible colliders? Also no Colliders in the Herachy of the Object. This is an single Game Object and only have an Single Character Controller?! Do you have any idear?

why not directly: dĂ­r = transform.forward; ?

can you post a screenshot of the hierarchy and the inspector of the player?