View source for Make one actor face another - EDukeWiki

# View source for Make one actor face another

← Make one actor face another

You do not have permission to edit this page, for the following reasons:

- The action you have requested is limited to users in the group: Users.
- You must confirm your email address before editing pages. Please set and validate your email address through your user preferences.

You can view and copy the source of this page.

In this example code, the [[actor]] will find the closest PIGCOP actor within 2048 units and face towards it. This code does not contain the [[gamevar]] definitions, which must be placed outside of the actor code. <pre> 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 } </pre> [[Category: Tutorials]]

Return to Make one actor face another.

Retrieved from "http://wiki.eduke32.com/wiki/Make_one_actor_face_another"