Loading...

Logo
DocumentationBehaviorsObjectHitPoint Test
Object

HitPoint Test

Last updated May 2, 2023

Description

The HitPoint Test behavior places an imaginary invisible point on the scene and test if any objects intersect with that point. This only tests for non-scenery objects.

Properties

Triggers Once on Event

Raycast Type
  • Object with Highest Z - Only the object with the highest z order that the point intersects will be included as an entry. This can simulate a touch.

  • Object with Lowest Z - Only the object with the lowest z order that the point intersects will be included as an entry.

  • All Objects - Every object that the point intersects will be included in the result. The object, x_pos, y_pos and distance output fields will be an array.

Layer

The point will only intersect with objects in a layer you have selected. You have an option to unrestrict the point to all layers.

Intersect With

The point can intersect with any non-scenery object or can only intersect with objects you have selected. You can use tag(s) to determine which group of objects the point can intersect with.

Origin Point

The starting world position where the point will originate from.

Origin Size

The radius of the point in meters.

Outputs

Object

The behavior will output the ID of the object that was intersected.

X

The behavior will output the world position of the nearest location where the point is no longer intersecting the object along the X axis within the radius.

Y

The behavior will output the world position of the nearest location where the point is no longer intersecting the object along the Y axis within the radius.

Distance

The behavior will output the distance that the origin has to be displaced to be outside the object.

Intersected

The behavior will output 1 if the point has intersected with any object. If the point did not intersect with any object, the behavior will output 0 instead.

76F61ADA-9264-48FB-BD6F-15C6F5015463.jpeg

Examples

  • You can check if the player is within a specific area in the scene.
  • You can create a weapon system where your player's attacks can damage surrounding enemies.
  • You can have explosions that can damage the player and enemies within a radius.

Raycast Test

Is Intersecting