How to slow down game play

Hello everyone im having trouble with the gameplay i have the script working but when you drag to shoot player forwards its too fast and i was wandering how to slow down the gameplay when dragging and shooting here’s my script. thx

using UnityEngine;

public class ShootBall : MonoBehaviour
{
private LineRenderer _lineRenderer;
public void Start()
{
_lineRenderer = gameObject.AddComponent();
_lineRenderer.SetWidth(0.2f, 0.2f);
_lineRenderer.enabled = false;
}

private Vector3 _initialPosition;
private Vector3 _currentPosition;
public void Update()
{
if (Input.GetMouseButtonDown(0))
{
_initialPosition = GetCurrentMousePosition().GetValueOrDefault();
_lineRenderer.SetPosition(0, _initialPosition);
_lineRenderer.SetVertexCount(1);
_lineRenderer.enabled = true;
}
else if (Input.GetMouseButton(0))
{
_currentPosition = GetCurrentMousePosition().GetValueOrDefault();
_lineRenderer.SetVertexCount(2);
_lineRenderer.SetPosition(1, _currentPosition);

}
else if (Input.GetMouseButtonUp(0))
{
_lineRenderer.enabled = false;
var releasePosition = GetCurrentMousePosition().GetValueOrDefault();
var direction = releasePosition - _initialPosition;
Debug.Log("Process direction " + direction);
}
}

private Vector3? GetCurrentMousePosition()
{
var ray = Camera.main.ScreenPointToRay(Input.mousePosition);
var plane = new Plane(Vector3.forward, Vector3.zero);

float rayDistance;
if (plane.Raycast(ray, out rayDistance))
{
return ray.GetPoint(rayDistance);

}

return null;
}

}

Time.timeScale can be used to slow down time if that’s what you mean.

a value of 1 is default time, any less is slo-mo, and more is super speed.

Oh Ok im new to scripting please can you right the script lol

Time.timeScale = 0.5f; //half speed

Please don’t post duplicate threads:

How to make game play slower when dragging and shooting

You can go back and editor your threads.

ALSO, please use code tags: Using code tags properly

How to report problems productively in the Unity3D forums:

http://plbm.com/?p=220

Help us to help you.