i need help making a dash ability for my endless runner game

the best i could make is a script that teleports the player but im looking for more of a megaman like dash.

using UnityEngine;
using System.Collections;

public class Dashing : MonoBehaviour {

Vector3 tempPos;
public float timeBetweenDashes = .1f;
private float timestamp;
void Update() {
	if(Time.time >= timestamp && (Input.GetKeyDown (KeyCode.D)))
	{    
		tempPos = transform.position;
		tempPos.x += 3f;
		transform.position = tempPos;
		timestamp = Time.time + timeBetweenDashes;
	}
}

}

Could you post your movement class? I guess you have a default speed, why not just increase the movement speed for some seconds? Start a Coroutine which increases the speed, yield return WaitForSeconds(xy) and then decrease the speed.

still a little ugly but much better than what i had before

using UnityEngine;
using System.Collections;

public class Dashing : MonoBehaviour {

bool dashing = true;
Vector3 tempPos;

void Start()
{
	
}

void Update () 
{
	if (Input.GetKeyDown (KeyCode.D)) 
	{
		StartCoroutine ("TimerDash");
	}
}

IEnumerator TimerDash()
{
	while (dashing) 
	{
		Debug.Log ("Dash");
		tempPos = transform.position;
		tempPos.x += .5f;
		transform.position = tempPos;
		yield return new WaitForSeconds (.001f);
		Debug.Log ("Dash");
		tempPos = transform.position;
		tempPos.x += .5f;
		transform.position = tempPos;
		yield return new WaitForSeconds (.001f);
		Debug.Log ("Dash");
		tempPos = transform.position;
		tempPos.x += .5f;
		transform.position = tempPos;
		yield return new WaitForSeconds (.001f);
		Debug.Log ("Dash");
		tempPos = transform.position;
		tempPos.x += .5f;
		transform.position = tempPos;
		yield return new WaitForSeconds (.001f);
		Debug.Log ("Dash");
		tempPos = transform.position;
		tempPos.x += .5f;
		transform.position = tempPos;
		yield return new WaitForSeconds (.001f);
		Debug.Log ("Dash");
		tempPos = transform.position;
		tempPos.x += .5f;
		transform.position = tempPos;
		yield return new WaitForSeconds (.001f);
		Debug.Log ("Dash");
		tempPos = transform.position;
		tempPos.x += .5f;
		transform.position = tempPos;
		yield return new WaitForSeconds (.001f);
		Debug.Log ("Dash");
		tempPos = transform.position;
		tempPos.x += .5f;
		transform.position = tempPos;
		yield return new WaitForSeconds (.001f);
		StopCoroutine ("TimerDash");
	}
}

}