Logo
UI Elements

Raycast Area

An invisible UI hit target without rendered geometry

Overview

Raycast Area receives UI pointer hits without drawing geometry. Use it for an invisible button surface, a drag area, or a larger hit area around visible content.


Usage

Add Raycast Area to a RectTransform under a Canvas.

Size the rectangle to the intended hit area.

Add Interactive or a pointer-handler component to respond to events.

Keep the Canvas GraphicRaycaster and EventSystem enabled.


Notes

This is a rectangular UI hit target. For hits that follow a visible procedural outline, use Procedural Shape’s Shape raycast mode. An invisible raycast target can still block controls behind it, so size it intentionally.


Public API

Use RaycastArea in the Evo.UI namespace.

Methods

NameParametersDescription
ResolveRaycast()GameObject targetObjectFinds a usable Graphic on a target or adds a RaycastArea when required. Returns Graphic.

Inherited properties

raycastTarget controls whether this Graphic receives hits. Its RectTransform determines the hit area.

Example

RaycastAreaExample.cs
using UnityEngine;
using Evo.UI;

public class RaycastAreaExample : MonoBehaviour
{
    [SerializeField] private RaycastArea target;

    private void Start()
    {
        target.raycastTarget = true;
    }
}

On this page