Make one actor face another

From EDukeWiki
Revision as of 20:33, 16 February 2005 by Usurper (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

In this example code, the actor will find the closest PIGCOP actor and face towards it.

findnearactor PIGCOP 2048 TEMP
ifvarn TEMP -1
{
        getactor[TEMP].x MX
        getactor[TEMP].y MY
        getactor[THISACTOR].x x
        getactor[THISACTOR].y y
        subvarvar MX x
        subvarvar MY y
        getangle ANGVAR MX MY
        setactor[THISACTOR].ang ANGVAR
}