Background for Skyrim SE
Member of the Form script

Description

Wiki Description

Listens for target (See notes) changes of the crosshair, for this event to be received the form must have been registered previously via Form.RegisterForCrosshairRef().

Syntax

Event OnCrosshairRefChange(ObjectReference ref)

Parameters

  • ref: The ObjectReference that is targeted (Can be None).

Examples

Event OnInit()
    RegisterForCrosshairRef()
EndEvent
 
Event OnCrosshairRefChange(ObjectReference ref)
    If ref ;Used to determine if it's none or not.
        Debug.Trace("Crosshair had " + ref + " targeted.")
    EndIf
EndEvent

Documentation Comment

Note: ref is none for no target


Caveats

CK Wiki - Notes

  • Targets are defined as anything the player can interact with, activators, actors, containers, doors, potions, and miscobjects can generally all be considered targets for example.

Parameters

  1. ObjectReferenceref


Examples

No human-generated examples found for this event.

Auto-Generated Example

Scriptname MyCoolScript extends Form

event OnCrosshairRefChange(ObjectReference ref)
    Debug.trace("Event received - OnCrosshairRefChange: ref = " + ref)
endEvent

Related Pages


Additional References

View this event’s page on the Skyrim Creation Kit Wiki

Some data provided by the Skyrim Creation Kit Wiki. Licensed under the Creative Commons Attribution-ShareAlike license.