GameObject Target { get; set; }

book_4_sparkGenerated
code_blocksInput

Description

The Target property of the ModelHitboxes class specifies the GameObject that will be reported in trace hits. If this property is not explicitly set, it defaults to the GameObject on which the ModelHitboxes component is attached.

Usage

To use the Target property, you can assign a GameObject to it. This is useful when you want to specify a different object to be reported in trace hits, rather than the default object the component is attached to.

Example

// Example of setting the Target property

// Assume 'modelHitboxes' is an instance of ModelHitboxes
// and 'someGameObject' is an instance of GameObject

modelHitboxes.Target = someGameObject;

// If you do not set the Target, it will default to the GameObject
// that the ModelHitboxes component is attached to.