Teleporting instead of Moving

Hi there. I’m trying to make a game similar to Enter the Gungeon, but I’m having problems with a dodge roll-like mechanic. My problem here is that my character teleports instead of moving when she performs a combat roll (Shown in the video).

My code is as follows:

public void CombatRoll() //Right Click to Combat Roll
    {
        if (Input.GetMouseButtonDown(1) && rolling == false)
        {
            //Debug.Log("Rightclicked");
            if (Input.GetKey(KeyCode.D))
            {
                Debug.Log("D");
                animator.SetBool("CRolling", true);
                rolling = true;
                immune = true;

                Vector3 rollDistance = new Vector3(+30, +0, 0f) * speed * Time.deltaTime;
                transform.position = Vector3.MoveTowards(transform.position, rollDistance, speed * Time.deltaTime);

                Debug.Log("CombatRollRight");
                Invoke("RollCooldown", 1);
                Invoke("ImmuneRoll", 0.4f);
            }
        }
    }

How do I fix this? Thanks in advance.

Why spam / create several threads for one question?

I realised that I posted it in the wrong section and idk what to do about it, so…

Whenever you set transform.position directly you are doing a teleport technically. The trick is to do a small enough movement per frames that it looks fluid. It looks like you are trying to accomplish the entire combat roll movement in a single frame though.

You should use your rolling bool in Update or otherwise check it each frame and slowly do your entire movement. I’m guessing your “speed” variable is high enough to produce this jump, as for why you’re actually teleporting in this specific frame. Whatever speed is set to, multiply it by a typical delta time. That number is how many units you’re telling it to teleport in this one frame.