Main Page | Recent changes | Edit this page | Page history

Printable version | Disclaimers | Privacy policy

Not logged in
Log in | Help
 

Make one actor face another

From EDukeWiki

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.

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
}

Retrieved from "http://sc8-pr-shell1.sourceforge.net../../../m/a/k/Make_one_actor_face_another.html"

This page has been accessed 398 times. This page was last modified 04:35, 17 February 2005 by EDukeWiki user Usurper. Content is available under SourceForge.


[Main Page]
Main Page
Recent changes
Random page
EDuke32.com

Edit this page
Discuss this page
Page history
What links here
Related changes

Special pages
Bug reports