Legacy Documentation: Version 4.6(go to latest)
Language: English
  • C#
  • JS
  • Boo

Script language

Select your preferred scripting language. All code snippets will be displayed in this language.

Event.mousePosition

public var mousePosition: Vector2;

Description

The mouse position.

Used in EventType.MouseMove and EventType.MouseDrag events.

See Also: Event.delta.

	// Prints the current mouse position
	function OnGUI () {
		var e : Event = Event.current;
		Debug.Log(e.mousePosition);
	}