Stare Check Component
This component belongs to the following package:
- com.yahaha.sdk.horrorgame
The Stare Check component determines if the main camera is focusing on a specified object using either raycast or frustum check methods. It triggers events when the focus starts, ends, or persists for a specified duration.
Property | Description |
---|---|
Enable on Start | If enabled, performs a focus check when the game starts. Disabled by default. |
Auto Disable | If enabled, stops checking when the main camera is no longer focusing on the target object. Disabled by default. |
Key Game Object | The object to check for camera focus. |
Ray Cast Check | If enabled, uses raycasting to determine focus. Enabled by default. |
Max Ray Cast Length | Maximum length of the raycast. |
TRS Cone Check | If enabled, uses the camera's frustum to determine focus. Disabled by default. |
Cone Check Angle | The angle of the camera frustum cone. Default: 20. |
Cone Check Length | The length of the camera frustum cone. Default: 5. |
Key GOPosition Offset | Adjusts the check position relative to the target object's transform. Default: 0,0,0. |
Enable Highlight | Enables highlight outline when checking. Disabled by default. |
Raise Keep Stare Event | If enabled, triggers a KeepStare event when focus persists. |
Stare Time | Duration (in seconds) required to trigger the KeepStare event. |
Trigger
Events:
- com.yahaha.sdk.horrorgame.StartStareAt
- Description:
- Notified when starting to look at the target object.
- Description:
- com.yahaha.sdk.horrorgame.StopStareAt
- Description:
- Notified when stopping looking at the target object.
- Description:
- com.yahaha.sdk.horrorgame.KeepStare
- Description:
- Notified when staring at the target object for a specific time.
- Description:
Condition:
- IsLookAt
- Returns:
- checkResult: boolean If true, the main camera is focusing at the target object, or false if not. Action:
- Returns:
Action:
- EnableStareCheck
- Description:
- Enables the stare check.
- Description:
- DisableStareCheck
- Description:
- Disables the stare check.
- Description:
Related components
This component is usually used with Event Trigger, which sets conditions and actions in response to an event or trigger.