Wintermute Engine Forum

Wintermute Engine => Technical forum => Topic started by: Dionysius on February 15, 2008, 07:12:48 AM

Title: TurnTo(object) problem
Post 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):
Code: [Select]
#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?
Title: Re: TurnTo(object) problem
Post by: Mnemonic on February 15, 2008, 08:21:32 AM
It uses the base point of the entity (i.e. its X and Y coordinates you can see in SceneEdit).
Title: Re: TurnTo(object) problem
Post by: metamorphium on February 15, 2008, 08:46:40 AM
I sometimes use this trick (especially when I need to force 3d running/flying actor to turn correctly to any direction I need):

Code: [Select]
on "LeftClick"
{
   var dummy = Scene.CreateEntity();
   dummy.X = 100;
   dummy.Y = 100;

   someactor.TurnTo(dummy);
   Scene.DeleteEntity(dummy);

}

:)