Announcement

Collapse
No announcement yet.

Character Movement wrong replicated

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Character Movement wrong replicated

    Hi guys.
    I have a problem with my Character Blueprint.

    Following Setup: I have a variable(Enum) that keeps track of the current Movement (Idle, Walking, Running, Jumping, Hanging on Ledge, etc. ).
    A (kind of) stateMachine is called via Event Tick to check Environment and change the Variable accordingly.

    I use the CharacterMovement Variable "Current Floor" to check if the Player has walkable Ground under it.
    The Enum is also used to change Animations.

    In Single Player, everything works fine.
    With a Listen Server, only the Server works fine.
    With a Dedicated Server, nothing works correctly.

    This is the Variable:
    Click image for larger version

Name:	ga1fzCs.png
Views:	1
Size:	36.4 KB
ID:	1185121









    The Current Floor returns "false" for Clients thus the Clients going into the State "SoftFall" and playing the animation for it.
    Only the Listen Server works fine. But not just that: on the Clients, they play the "SoftFall" Animation, while on the Server, every Player plays the Idle Animation. I.e.
    On the Server every Character plays the correct Animation(but Wrong Enum Value), on the clients, every Character plays the wrong animation (and wrong Enum Value)




    Does someone know what's the Problem?

    #2
    Are you calling the events from client to the server correctly? I don't see in your pictures triggering an event on server. The functions should be replicated to server, too.

    Comment


      #3
      How exactly do I do this?

      Comment


        #4
        I think the following steps should work:

        * Change your State Machine function adding the Movement State as an input parameter

        * Create a custom event that runs on server and add Movement_State enum as parameter.

        * Inside your state Machine function, pin the enum input to the switch (seems like the same as before, I know), the first node must be "Switch has authority". In the Authority exec pin you pin it to the Switch enum. In the Remote exec pin, you call the Custom Event you just created, then pin it to the switch. Don't forget to pass the enum parameter to the event.

        * Final step: In the custom event, call the State Machine function and pass the input enum as parameter to it.
        Last edited by StarfireDev; 05-31-2016, 08:43 AM.

        Comment

        Working...
        X