Announcement

Collapse
No announcement yet.

Project World to Screen not working/returning false?

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

    Project World to Screen not working/returning false?

    I'm trying to use the "project world to screen" node (assuming it works like convert world location to screen location...) to check if an actor is in my screen. This is how I'm currently setting this up: http://i.imgur.com/quBmaWJ.png

    This is in a multiplayer project. As of right now, its running on a server and playing with split screen. I think I've boiled it down to the pins, Screen position X and Y, that are returning 0.0 and I'm not sure why.

    #2
    You use player controller with index 1. default one is 0. Maybe there is a problem?
    Try to check IsValid for controller before use.
    Rocketeer

    my portfolio
    my youtube

    Camera Volumes System
    Instanced Plugin
    Simple Portals
    Water Flow For UDK
    Setup Swarm

    Comment


      #3
      Ah, I forgot to say why I set it up this way. I'm trying to get player 2's world location to screen location on player 1's screen. Basically, I want to detect player 2's actor on player 1's screen.

      Comment


        #4
        Does Player 2 actually exist though?

        If this is a multiplayer game taking place over internet or LAN - the only player controller that exists is the local one (for clients). If it's split-screen, you're ok.

        Comment


          #5
          Yeah, I've tested whether or not player 2 exists. I can print out both player controller reference's: http://i.imgur.com/1xbfwlk.png

          As of right now, I'm controlling player 1 with KBM and player 2 with xbox controller.

          Comment


            #6
            Well they both exist on the Server, but not on the Client. Only one Player Controller ever exists on the Client.

            Therefore if your code is running Client-Side, it will fail.

            Comment


              #7
              Originally posted by Falconeyi View Post
              I'm trying to use the "project world to screen" node (assuming it works like convert world location to screen location...) to check if an actor is in my screen. This is how I'm currently setting this up: http://i.imgur.com/quBmaWJ.png

              This is in a multiplayer project. As of right now, its running on a server and playing with split screen. I think I've boiled it down to the pins, Screen position X and Y, that are returning 0.0 and I'm not sure why.
              If I recall correctly, return from ProjectWorldToScreen node is undefined if World Position is outside of camera space. There where several discussions on the forum regarding on screen indicators and how to properly implement them, using ProjectWorldToScreen is just not enough to make it work.
              Youtube Channel

              Comment


                #8
                I think it is better for you to save both characters world location on server. Maybe in game mode/game instance. Then get it by every player as simple variable and use.
                Rocketeer

                my portfolio
                my youtube

                Camera Volumes System
                Instanced Plugin
                Simple Portals
                Water Flow For UDK
                Setup Swarm

                Comment


                  #9
                  Why not use the actor and dot the locations and see if it's within an angle of forward vector
                  Inphidel / Brian - Developer of Ultraball
                  http://www.ultraballgame.com

                  Don't shy away from bugs in your game. Don't play it as intended. Break your game so you can fix it!

                  Comment

                  Working...
                  X