animations play slow on lan

  • Two Factor Authentication is now available on BeyondUnreal Forums. To configure it, visit your Profile and look for the "Two Step Verification" option on the left side. We can send codes via email (may be slower) or you can set up any TOTP Authenticator app on your phone (Authy, Google Authenticator, etc) to deliver codes. It is highly recommended that you configure this to keep your account safe.

johnnymak

New Member
Mar 28, 2005
22
0
0
I tried to change this code (thanks Switch) so it would work in a netgame.
just added SimAnim calls and bReplicateAnimations=true. The actor changes animation but plays them very sloooow. The location seems to update at normal speed. SimAnim.AnimRate seems to have no effect. anim speed is normal in offline. thanks for any suggestions.


Code:
class UDNChick extends Actor Placeable;

var MeshAnimation   Anim;           // anim object

var name            ANIM_Wander;    // anim names
var name            ANIM_Idle;      //
var name            ANIM_Move;      //
var name            ANIM_Next;      //

var int             RootCountdown;  //
var bool            bRootReset;     //


event PostBeginPlay()
{
    // cancel summon rotation
    SetRotation( default.Rotation );

    // setup mesh & anim
    LinkMesh( default.mesh );
    LinkSkelAnim( default.Anim );
    LockRootMotion(1);

    PlaySomeAnim();
}

event Tick( float DeltaTime )
{
    local vector RootDelta;

    // another call to GRLD() will result in zero offset
    if( bRootReset && --RootCountdown < 0 )
    {
        GetRootLocationDelta();
        bRootReset = false;
    }

    RootDelta = GetRootLocationDelta();
    MoveSmooth( RootDelta );

    // HACK: no bForceSkelUpdate so update skeleton manually
    GetBoneCoords('');
}

event AnimEnd( int Channel )
{
    PlaySomeAnim();
}




function PlaySomeAnim()
{
    local float rand;

    rand = FRand();
    if      ( rand > 0.66 )     ANIM_Next = Anim_Move;
    else if ( rand > 0.33 )     ANIM_Next = Anim_Wander;
    else                        ANIM_Next = Anim_Idle;

    Log( Level.Timeseconds @ ANIM_Next );

    PlayAnim( ANIM_Next, 1, 0.0, 0);
    SimAnim.AnimSequence = ANIM_Next;
    SimAnim.AnimRate = 1.0;
    SimAnim.bAnimLoop = true;
    SimAnim.TweenRate = 0.0;

    RootCountDown = default.RootCountDown;
    bRootReset = true;
}

defaultproperties
{
     Anim=MeshAnimation'UDN_CharacterModels_K.GenericFemaleAnims'
     ANIM_Wander="Snowball"
     ANIM_Idle="IdleLong"
     ANIM_Move="Push"
     RootCountdown=1
     DrawType=DT_Mesh
     Mesh=SkeletalMesh'UDN_CharacterModels_K.GenericFemale'
     Skins(0)=Texture'UDN_CharacterModels_T.gcloth'
     Skins(1)=Texture'UDN_CharacterModels_T.Gskin'
     bReplicateAnimations=true
}