Wintermute Engine Forum
Wintermute Engine => Technical forum => Topic started by: Dionysius on February 15, 2008, 07:12:48 AM
-
How to TurnTo(object) method works? I use this code for scene objects (region entities):
#include "scripts\base.inc"
on "LeftClick"
{
actor.TurnTo(this);
actor.Talk("blah-blah");
}
Sometimes I don't like how the actor is turned. How TurnTo() method calculates the direction?
-
It uses the base point of the entity (i.e. its X and Y coordinates you can see in SceneEdit).
-
I sometimes use this trick (especially when I need to force 3d running/flying actor to turn correctly to any direction I need):
on "LeftClick"
{
var dummy = Scene.CreateEntity();
dummy.X = 100;
dummy.Y = 100;
someactor.TurnTo(dummy);
Scene.DeleteEntity(dummy);
}
:)