immersivecognition / unity-experiment-framework

UXF - Framework for creating human behaviour experiments in Unity
https://immersivecognition.github.io/unity-experiment-framework/
MIT License
221 stars 43 forks source link

CursorTracker script? #45

Closed jackbrookes closed 4 years ago

jackbrookes commented 4 years ago

Inherits from Tracker Gets Input.mousePosition References a camera Transforms into 3D? Saves Vector3 data

public float depth = 1f;
public Camera mainCamera;

...

Vector3 worldPosition = mainCamera.ScreenToWorldPoint(new Vector3(Input.mousePosition.x,Input.mousePosition.y, depth));