From SRB2 Wiki
Jump to navigation Jump to search

A_Look is an action that looks for a player and sets them as the new target. The upper 16 bits of Var1 can be used to specify a distance limit in fracunits. Only players within that limit can be targeted. If the lower 16 bits are set to 0, the actor only looks in front of itself, otherwise it looks all around. Once a target is found, the actor switches into its SeeState and A_PlaySeeSound is called to play its SeeSound. If Var2 is set to 1, it will only switch to its SeeState; if Var2 is set to 2, it will only play its SeeSound.

Object property Use
SeeState Goes to this state when a target is found (Unless Var2 = 2)
SeeSound Plays this sound when a target is found (Unless Var2 = 1)
Attributes Use
Var1 Upper 16 bits: Distance limit

Lower 16 bits: 0 – looks only in front; 1 – looks all around

Var2 0 – Plays SeeSound and goes to SeeState
1 – Goes to SeeState
2 – Plays SeeSound

  Actions – Checking [view]