ph_hit
ph_hit applies a scripted hit to a physical object when the section activates. Use it for one-shot impacts, breaking
props, kicking an object, or driving door and physics reactions through the normal hit API.
The hit is created by PhysicalHitManager during activation. The manager does not wait for actor interaction.
Parameters
power
Type: number. Optional. Default: 0.
Hit power.
impulse
Type: number. Optional. Default: 1000.
Hit impulse.
bone
Type: string. Required. Default: none.
Bone name passed to the hit object.
dir_path
Type: string. Required. Default: none.
Patrol path whose first point defines the hit direction.
The section also supports common switch fields such as on_info and on_timer.
Example
[logic]
active = ph_hit@kick
[ph_hit@kick]
power = 0.5
impulse = 1200
bone = door
dir_path = kick_direction
on_timer = 100 | ph_idle@after_hit
Runtime sequence
SchemePhysicalHit.activatereads common switch conditions and hit fields.dir_pathis resolved as a patrol path, and point0is used as the direction target.- The manager builds a
hitobject withpower,impulse,bone,type = hit.strike, and the calculated direction. - The physical object receives the hit through
object.hit(...). - Later updates only evaluate common section switching.
Notes
boneanddir_pathare required. Missing values fail during scheme activation.- The hit direction is calculated from the object position toward point
0ofdir_path. - The hit type is
strike. - The hit is applied on activation. Common switches are checked during later updates.
- Use an
on_timeror another common switch when the object should move to an idle section after the impact.