I am making an object move continuously and the code for that is:
myRenderer = gameObject.GetComponent<SpriteRenderer>();
speed_target = Random.Range (15, 20);
rigidbody.velocity = transform.right * speed_target;
I have another gameobject which when clicked has to reduce the speed of this moving object.
Please tell me the code which has to be written in this Script in void OnMouseDown.