Announcement

Collapse
No announcement yet.

HTF do I get a cube attached to a VR pawn to rotate in multiplayer on both client and server?

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

    HTF do I get a cube attached to a VR pawn to rotate in multiplayer on both client and server?

    Hi loosing my mind a little, have read many forum posts and seen videos and read all the unreal docs.
    What Im trying to do is get my = pawn, based on VirtualRealityBP motion controller pawn to have a cube that rotates when the HDM rotates. After many different approaches im now trying the RepNotify function but i cant get client pawns cube rotation to show up on the server. The client can see both her own and the server cube rotating

    The pawn is set up like this


    and the replicated Camera updates a replicated variable 'Cube rotation' which is set to RepNotify.
    In the OnRep_Cuberotation function the cubes rotation is set to the Cube Rotation variable, like this ...



    So runing a listen server, on the server I can see the cube rotating with the hmd, on the client machine i can see botth the client cube and servers cubes rotating, but i cant see the client cube rotating from the server. I thought that " RepNotify provides a Function that is called that executes on both the Server and Client machines whenever the variable it is attached to updates."

    So whats up?

    Why the absolute fudge is it so fricking hard to get the variable from the client?
    Attached Files
    Last edited by Gibson_Martelli; 05-27-2018, 12:56 PM.

    #2
    Maybe try this: before you set replication, or in the construction script (ideally), set the bool of "Replicate Component". If its a default component you can use the function "Set Is Replicated". I recommend using the Switch Has Authority node to ensure that the server is the one setting replication. From my knowledge rep-notify should be working for this, though.
    Last edited by Kinesi_EG; 05-27-2018, 11:38 PM.

    Comment


      #3
      ok thanks i will try that like this right now

      Click image for larger version

Name:	
Views:	0
Size:	188.6 KB
ID:	1481582

      Comment


        #4
        ok doing that, what happened is, client can see self and server cube rotating, server can see self, cant see client cube rotating
        Last edited by Gibson_Martelli; 05-28-2018, 04:24 AM.

        Comment


          #5
          Ok in the end implementing a version of a solution from eXi actually worked. I cannot believe that it needs to be this complex to do this....WTAF

          Click image for larger version

Name:	
Views:	0
Size:	174.9 KB
ID:	1481642

          Comment


            #6
            oh and it turns out that you don't need to explicity set the component replication if the tick box in the Pawn components is ticked

            Comment


              #7
              Cool, glad you figured it out. Good problem solving.

              Comment

              Working...
              X