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.

RectTransformUtility.ScreenPointToWorldPointInRectangle

public static function ScreenPointToWorldPointInRectangle(rect: RectTransform, screenPoint: Vector2, cam: Camera, worldPoint: Vector3): bool;

Parameters

rect The RectTransform to find a point inside.
cam The camera associated with the screens space position.
screenPoint Screen space position.
worldPoint Point in world space.

Returns

bool Returns true if the plane of the RectTransform is hit, regardless of whether the point is inside the rectangle.

Description

Transform a screen space point to a position in world space that is on the plane of the given RectTransform.