I have run into a baffling bug.
When I use a loop to try to make a character jump to consecutively furthur points from its current location (stop motion animation) instead of travelling from its current location to the futhest point, it goes from the furthest point to the closest!
Here's the code:
void StartMovement(object oMover)
{
object oWaypoint = GetWaypointByTag("203_wpt_mounain_slide_halfway");
float fAngle = GetAngleBetweenObjects(oMover,oWaypoint);
location lStartLocation = GetLocation(oMover);
vector vOldVector = GetPositionFromLocation(lStartLocation);
float fDistance = -0.2;
int nCycle = 0;
vector vNewVector;
location lNewLocation;
while (nCycle < 20)
{
vNewVector=GetChangedPosition(vOldVector,fDistance,fAngle);
lNewLocation=Location(GetArea(oMover),vNewVector,fAngle);
AssignCommand(oMover,JumpToLocation(lNewLocation));
fDistance = fDistance + 0.02;
// vOldVector = vNewVector;
nCycle++;
}
}
I tested the code by placing down objetcts with their tags increasing from 0 -20 sequentially, and they are placed in the right order. Lowest numbered tags closest to character, but the character jumps to the end and works its way back, even while the objects are being placed down in the right order! Crazy!
I tried to use an artificial HB script instead of a basic loop but couldn't get that to work either.
Stop Motion Animation for the PC
Débuté par
M. Rieder
, avril 30 2011 02:53





Retour en haut






