Hi I got this code working fine from the forums but Ive been studying along with C# I tried converting this myself but It doesnt work, I’m still a newbie I hope you can help me, thanks in Advance.
this code is used to make an object follow the mouse cursor in world space by putting this code to the object you want to follow the cursor.
#pragma strict
var depth = 10.0;
function Start ()
{
Screen.showCursor = true;
}
function Update ()
{
var mousePos = Input.mousePosition;
var wantedPos = Camera.main.ScreenToWorldPoint (Vector3 (mousePos.x, mousePos.y, depth));
transform.position = wantedPos;
}