Announcement

Collapse
No announcement yet.

How to teleport from ingame menu in VR-template

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

    How to teleport from ingame menu in VR-template

    Hi. I'm working on an VR archviz project where I've used the VR template as a base. Teleportation using the blue line on the floor works well.

    But how can I open up an ingame menu with the shoulder button, where I can have buttons that teleports the pawn (player) to other rooms in the model?

    I've tried all sorts of things, but always end up with some strange non-working casts to or menus that aren't clickable or rotating correctly to the camera, because apparently it's not possible to write blueprints in the interaction widget that refers to actors and teleportations.

    I'm using Vive. Please help.

    Thank you.

    #2
    I think you need something called "Nav Mesh Bounds Volume" or similar, the teleporter can only teleport if that exists. Have a look in the viewport of the template and search for it

    Edit:
    I am not sure if that's what you want but I hope so ? cause you were saying teleport. Or did you mean travel? As in map changing?

    Comment


      #3
      Originally posted by Simple2012 View Post
      I think you need something called "Nav Mesh Bounds Volume" or similar, the teleporter can only teleport if that exists. Have a look in the viewport of the template and search for it

      Edit:
      I am not sure if that's what you want but I hope so ? cause you were saying teleport. Or did you mean travel? As in map changing?
      Thanks for your response.
      I have got that kind of teleporting in order. But in addition to this, I want a menu popping up when pushed Trigger on the Motion Controller with buttons from an Interaction Widget, where each button triggers a teleport (or instant pawn movement) to another location on the same map. Like teleporting from one floor to another, or a room to another.

      Comment


        #4
        Originally posted by chroma123 View Post
        Thanks for your response.
        I have got that kind of teleporting in order. But in addition to this, I want a menu popping up when pushed Trigger on the Motion Controller with buttons from an Interaction Widget, where each button triggers a teleport (or instant pawn movement) to another location on the same map. Like teleporting from one floor to another, or a room to another.
        Alright so you want to create something similar to the Waypoints in Diablo 2? ;D
        Well, assuming you know how to open the menu, I think you could simply just update the location of the playercontroller->getControlledPawn to the new destination I guess. Although, if you want some sort of animation for that, you may also play it, unfortunately I cannot guide you on how to do that.

        Comment


          #5
          I know how to open the menu, but I haven't figured out how to make it appear in front of the VR camera. I also haven't understood how to update the location of the playercontroller in the widget blueprint. On the other hand, I can't do anything based on the trigger in the widget blueprint, because the OnEvent custom trigger isn't showing there. However, it does show in the actor viewport, but there I can't tell the OnEvent trigger if the widget button is pressed or not. Was that understandable? I'm fairly new to UE4, but have a good understanding of the terminologies.

          Comment


            #6
            I would probably go about doing this by creating a UMG menu, create buttons for each room you want to teleport too, and then add a Widget Interaction Component to your motion controller. For event trigger or whatever you want to press buttons with, do Press Pointer or Simulate Pointer (something with Pointer) off the Widget Interaction component and do Left Mouse Button. This will let you click on widgets using the motion controller interaction component.

            For the button press, get player pawn, set position to X. Where X is the location of a room or whatever. You might want to set some target points up to use for this.


            Also, you want to move the location of the player pawn, not the player controller.

            To make the menu appear in front of the player, I'd set it up in the pawn - add a widget component, that is your TeleportationMenuWidget. Position it so it's attached to the motion controller and visible when you look at it. YOu'll both have to scale it down a lot, and set the draw size to be larger (by default it's 500x500 when widgets are 1080p by default).

            Then set a button to toggle the visibility of the teleportation menu widget.

            Comment


              #7
              Originally posted by Pinworm View Post
              I would probably go about doing this by creating a UMG menu, create buttons for each room you want to teleport too, and then add a Widget Interaction Component to your motion controller. For event trigger or whatever you want to press buttons with, do Press Pointer or Simulate Pointer (something with Pointer) off the Widget Interaction component and do Left Mouse Button. This will let you click on widgets using the motion controller interaction component.

              For the button press, get player pawn, set position to X. Where X is the location of a room or whatever. You might want to set some target points up to use for this.


              Also, you want to move the location of the player pawn, not the player controller.

              To make the menu appear in front of the player, I'd set it up in the pawn - add a widget component, that is your TeleportationMenuWidget. Position it so it's attached to the motion controller and visible when you look at it. YOu'll both have to scale it down a lot, and set the draw size to be larger (by default it's 500x500 when widgets are 1080p by default).

              Then set a button to toggle the visibility of the teleportation menu widget.
              Thanks! I like what I'm reading. I'm testing this.

              Comment


                #8
                Originally posted by Pinworm View Post
                I would probably go about doing this by creating a UMG menu, create buttons for each room you want to teleport too, and then add a Widget Interaction Component to your motion controller. For event trigger or whatever you want to press buttons with, do Press Pointer or Simulate Pointer (something with Pointer) off the Widget Interaction component and do Left Mouse Button.
                The widget is showing nicely now.
                I've added this to the motioncontroller blueprint, but I'm still not sure how to hover the buttons.
                Click image for larger version

Name:	trigger.PNG
Views:	1
Size:	139.4 KB
ID:	1124773

                Comment


                  #9
                  In the Widget Interaction Component, you need it to be attached to your Motion Controller, then turn Show Debug on, so you can see what you're looking at. Beyond that, it should just work to point and click buttons now in 3D worldspace widgets.

                  Also, you can't use the same widget interaction component on two motion controllers. You need a separate one for each (or just one in one hand)

                  Comment


                    #10
                    Thanks for your help. I'm still struggling. The menu shows. I had to invert the buttons to get them the right way, but it's there. That's a good thing. However, the menu will not toggle on/off, even if I have the code in there. It just spawns with the motioncontroller, also even if I put EventOnEndViewTarget connected to the Set Hidden in Game node.

                    I need to elaborate on my method, because I altered it a little from what you said. I have the teleportationMenuWidget in the motioncontroller, and the widgetInteraction with the debug on the pawn. This way, the line moves with the HMD and the menu moves with the motioncontroller. I found this more intuitive than the other way around.
                    Click image for larger version

Name:	teleportmenu3.PNG
Views:	1
Size:	302.0 KB
ID:	1124790

                    It turns off if I manually tick off Hidden in Game directly in the teleportationMenuWidget. So why doesn't the blueprint work?
                    Here's the blueprint.
                    (Click image for larger version

Name:	teleportmenu2.PNG
Views:	1
Size:	330.0 KB
ID:	1124788


                    Additionally, Get Player Pawn node is available in the pawn blueprint and level blueprint. That's not really where I need it.
                    The onReleased node is only available in the widget blueprint. So I'm kind of missing how to combine these across blueprints.
                    A logical way for my brain would be (and start from there):
                    Click image for larger version

Name:	logic.PNG
Views:	1
Size:	39.0 KB
ID:	1124796

                    But that is obviously not possible.
                    Last edited by chroma123; 03-16-2017, 07:34 AM. Reason: forgot to attach the image

                    Comment


                      #11
                      You can then do a "SetActorLocation" node by dragging a wire out of the blue "GetPlayerPawn"'s pin.
                      [Released] Multiplayer Combat Editor
                      A-RPG Sacred Swords
                      Auto-Chess Live Development
                      Youtube Tutorials

                      Comment


                        #12
                        Originally posted by Yun-Kun View Post
                        You can then do a "SetActorLocation" node by dragging a wire out of the blue "GetPlayerPawn"'s pin.
                        Originally posted by Yun-Kun View Post
                        You can then do a "SetActorLocation" node by dragging a wire out of the blue "GetPlayerPawn"'s pin.
                        But the onReleased node in that image has a fake white line which I painted in to show what would be logical. It's not able to connect these two. So then I wonder, in the widget blueprint, how to get a teleport function from the button action? It's possible to connect it better in the pawn, but there I don't have the button onReleased trigger ready. And in the Widget, the teleport node isn't available. It should have just been a teleport node with ability to select an object to teleport. But no.

                        Maybe you know of a method of getting the button onReleased trigger accessible in the Pawn blueprint?

                        Comment

                        Working...
                        X