Re: Retaining physics when changing object type
Everything that's a Movable Object has physics. To retain (though,
transfer would be the more accurate term in this case) physics from the TDExplosive to the AHuman (or any other MO), you have the properties:
Code:
myObject.Pos
myObject.Vel
myObject.RotAngle
myObject.AngularVel
Pos is the position of the object as a Vector(), Vel is Velocity of the object as a Vector(), RotAngle is the rotation in radians, and AngularVel is the rotational speed in radians per second if I recall correctly.
So you'd have something in your script like
Code:
if blah blah then
local actor = CreateAHuman("Dummy, or something");
actor.Pos = self.Pos;
actor.Vel = self.Vel;
actor.RotAngle = self.RotAngle;
actor.AngularVel = self.AngularVel;
...Team/AI definition maybe too?...
MovableMan:AddActor(actor);
end