Nysuatro
12-21-2009, 04:43 PM
I am readying this http://udn.epicgames.com/Three/MasteringUnrealScriptFunctions.html
And I am now on : Figure 6.6 – The creature rotates to face the new destination
There is said to type Velocity = Normal(MoveDirection) * Speed;
But after some lines they repeat the code and there is :
function SetRandDest()
{
local Int Idx;
local AmbientCreatureNode DestNode;
local Vector MoveDirection;
Idx = Rand(MyNodes.Length);
DestNode = MyNodes[Idx];
MoveDirection= DestNode.Location – Location;
DesiredRotation = Rotator(MoveDirection);
Velocity = Normal(MoveDirection * Speed);
}
Its a small thing but I thought I just could mention it so it can be changed.
Greetz
And I am now on : Figure 6.6 – The creature rotates to face the new destination
There is said to type Velocity = Normal(MoveDirection) * Speed;
But after some lines they repeat the code and there is :
function SetRandDest()
{
local Int Idx;
local AmbientCreatureNode DestNode;
local Vector MoveDirection;
Idx = Rand(MyNodes.Length);
DestNode = MyNodes[Idx];
MoveDirection= DestNode.Location – Location;
DesiredRotation = Rotator(MoveDirection);
Velocity = Normal(MoveDirection * Speed);
}
Its a small thing but I thought I just could mention it so it can be changed.
Greetz