I have a script that moves player with mouse ,
what I need is to apply gravity and other drag etc physics motions to it,
when this script is attached to gameobject gravity doesn’t work/apply since mouse take control over the rest I guess when I place the rigidbody 2d gravity nothing happens
so how do I apply gravity and or drag and other similar related physics?
this is 2d and javascript
var myCamera : Camera;
function Start () {
}
function Update () {
var vec : Vector3 = myCamera.ScreenToWorldPoint(Input.mousePosition);
var side : float = 8.0;
var top : float = 9.0;
vec.x = Mathf.Clamp(vec.x, -side, side);
vec.y = Mathf.Clamp(vec.y, -top, top);
vec.z = 0.0;
transform.position = vec;
}