Replication problem with SetRotation()

  • 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.

timmypowergamer

New Member
Jul 6, 2004
27
0
0
I ran into a strange problem the other day with a script I am writing. I am trying to make an actor always point at another actor. I got it working offline, but naturally it dosent work online so i had to delve into replication. I got the rest of my script working by making some of the functions simulated and replicating a few variables. But for some reason this part of my script will not work, and i dont understand why:
Code:
simulated event Tick(float TimeDelta)
{
        if (bActive)
        {
                GotoState('viewing');
                bActive=False;
        }
}

event Trigger (Actor Other, Pawn EventInstigator)
{
        bActive = True;
        Instigator = EventInstigator;
}

Simulated State Viewing
{
        simulated event Tick (float Delta)
        {
                local vector a, b;

                if (vtarget!= none)
                {
                        a = Self.location;
                        b = vtarget.location;

                        global.tick(Delta);
                        SetRotation(rotator(b - a));
                }
        }
}

Like i said, everything else works fine, so i know the functions are getting run on the client, not just the server. But I dont understand why this particular one would not work. Any ideas?
 

timmypowergamer

New Member
Jul 6, 2004
27
0
0
hmmn... good question.

I guess if it werent relevant it would be deleted, and thus it would never find the vtarget. Can I just add vtarget.bAlwaysRelevant=True to pre/postbeginplay?
 
Last edited:

timmypowergamer

New Member
Jul 6, 2004
27
0
0
Well, i just tried setting bAlwaysRelevant and bNoDelete to true on the actor i was trying to target. It didnt seem to effect anything.

[edit] Just realised i forgot to mention this: This is for UT99. Sorry i forgot to say that earlier.....
 
Last edited:

Hazard.ep

New Member
Oct 7, 2003
166
0
0
I do also have a strange replication bug with SetRotation. It seems that the pawn (this is where my problem is) updates rotation on the server, then gets the outdated value replicated from the client and then the client updates, which results in rotation being correct on the client, but not on the server. It is a problem that seems to have sth. to do with bFreeCam in my case, without this set to true it works fine.