So I am coding something for a hat.. when you frob the dacoration, you wear it on your head.. however, the code that I developed doesn't work.
[code]function Frob(Actor Frobber, Inventory frobWith)
{
dxp = DeusExPlayer(Frobber);
loc.Z = dxp.collisionHeight+ 4.0; // can adjust its height to any meshes head.
SetLocation(dxp.Location + loc);
SetRotation(dxp.Rotation);
SetCollision(False,false,false);
SetBase(dxp);
}
function tick(float deltatime)
{
super.tick(Deltatime);
if (dxp != None)
{
loc.Z = dxp.collisionHeight+ 4.0; // can adjust its height to any meshes head.
SetLocation(dxp.Location + loc);
SetRotation(dxp.Rotation);
SetCollision(False,false,false);
}
else
{
SetCollision(True,True,True);
SetPhysics(Phys_Falling);
SetBase(None);
}
} [/code]