PDA

View Full Version : Actor replicating animation


cyotic
22nd Aug 2005, 12:27 PM
Hey everyone, I hope someone knows a way around this.

I am trying to get an Actor to play an animation and have it play on all clients in the game. Nothing seems to work.


class A extends Actor
placeable;

var name AAnim;

replication
{
reliable if (Role == ROLE_Authority)
AAnim;
}

// Touched used to get my point across. Not the way it works :)
simulated function Touch(Actor Other)
{
PlayAnim(AAnim);
}

defaultproperties
{
DrawType=DT_Mesh
AAnim="AnimName"
.......
}

After numerous attempts to find a solution I have come up with one that does the job. The only thing is that I dont want to make everything a child of Pawn in order to have animations on an object.


class A extends Pawn;

var name AAnim;

simulated function Touch(Actor Other)
{
SetAnimAction(AAnim);
}

// Adding this in lets the Animation Play just like in the MyFirstExample tutorial.
simulated function SetAnimAction(name NewAction)
{
AnimAction = NewAction;
PlayAnim(NewAction);
}

defaultproperties
{
DrawType=DT_Mesh
AAnim="AnimName"
.......
}


Any help would be greatly appreciated.