HI guys. I made a cool little demo simulating my desk. I have a mouse and keyboard in the exact position of my real mouse and keyboard. it is eerily real feeling! I can reach out and touch the keyboard and it is really there!
As you can guess, my next step is make it DO something!
I’m trying to get my mouse object to follow the actual movements of my real world mouse.
I was able to get something “sort of working” I used the following script. The problem with this is that the mouse tracks my Oculus headmovement AND the mouse movement. The mouse is also mapped strangly in that up and down move the virtual mouse in the Y direction. X works, and Z does not.
Any help or ideas would be greatly appreciated.
Blade
#pragma strict
public var cursorObject : Transform;
public var distance : float = 0.5;
function Start()
{
Cursor.visible = false;
}
function Update()
{
ObjectFollowCursor();
}
function ObjectFollowCursor()
{
var ray : Ray = Camera.main.ScreenPointToRay(Input.mousePosition);
var point : Vector3 = ray.origin + (ray.direction * distance);
//Debug.Log( "World point " + point );
cursorObject.position = point;
}