Announcement

Collapse
No announcement yet.

ScreentoWorld? Another thread... good god.

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

    ScreentoWorld? Another thread... good god.

    Can the native function ScreentoWorld() be called on the server? I know its part of the interactions class and interactions are only created on the client but is there another way to access this function?

    #2
    What exactly are you trying to do? I think you would have better luck figuring out the location vector on the client using screentoworld, and then replicating that vector up to the server.

    Comment


      #3
      ScreenToWorld is always relative to a client's current view properties, i.e. camera location, camera rotation and FOV. Since FOV isn't known anywhere but on the client, a server cannot emulate a client's ScreenToWorld output. It can only attempt to validate it by checking line of sight and angle to view direction.

      What exactly are you trying to do and why would it involve executing ScreenToWorld on the server instead of the client?

      Comment


        #4
        I hate replication so I'm trying to avoid it at all costs. But your explanation makes sense. I will have to call ScreentoWorld() on the client and then try to replicate that to the server. I'm doing the same thing that others have done... make the free-moving crosshair on the screen and have it shoot where the crosshair is. I had it working before but not in netplay. The difference between mine and others is that i dont have a constant crosshair on the screen. So my screentoworld is only being called when the gun is fired. So is it possible to call the function... replicate it to the server... and then have the server finish the fire chain?

        Comment


          #5
          Why do you need ScreenToWorld in the first place? Can't you do it the other way around and calculate the crosshair position based on the situation and instead make the gun firing direction the "authorative" entity?

          Comment


            #6
            the only way to accurately calculate the world vector based on screen coordinates is the use screentoworld.

            Comment


              #7
              completely free to move crosshair, ie, the crosshair isn't tied to the position of the player in any way?

              Comment


                #8
                its tied to the player in that it only moves on the plane which is the players viewport.

                can anyone link me a past project that actually has this working in net play?

                EDIT: I may have found a way to make this work. The only thing that is holding me back is that I don't fully understand how replicated functions work. Could someone shed some light?

                Comment

                Working...
                X