Announcement

Collapse
No announcement yet.

3D Widget Wont Allow Casting for Clicking?

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

    3D Widget Wont Allow Casting for Clicking?

    I have a Blueprint in my scene with a Widget attached called "WBP_WallColors". The idea is for the user to aim at the wall color menu that's in 3D space, and click buttons on it, including cancel. Right now I can not get the buttons to interact with the trigger pull. Attached is a screenshot where Im simply trying to get the trigger to work.

    Click image for larger version

Name:	2016-03-18_UICastIssue.jpg
Views:	1
Size:	400.0 KB
ID:	1176562
    Eldridge Felder

    Animation/Visualization Manager
    WorthGroup Architects

    #2
    You can't interact with a widget with traces like that, they only respond to a cursor, I presume you don't have a visible cursor in your game?
    You get an error because you can't cast an actor to a widget, since widgets don't inherit from the actor class.


    So to do this with a trace, you would need to manually put in collision boxes around the clickable buttons.
    For example in this simple VR menu:

    Click image for larger version

Name:	6VMRy2x.png
Views:	1
Size:	195.4 KB
ID:	1102712

    I added collision boxes around each button.
    You then do your trace, but get Hit Component instead.

    There's a few ways of working out what has been clicked, when I done it, I used Get DisplayName, and an EndsWith node, you'll notice my collisions were named with a suffix, which is the index of that button.

    But you could also use tags, tag your collision box with either an index, or a string, use a ComponentHasTag node, or get tag node with a switch on string node for example.

    Comment


      #3
      Mosel3y,

      First, you rock for replying with exactly the information I'm looking for. Thanks a lot for this buddy!

      Second, this sounds promising and I will see what I can get. I am setting this up in a VR environment so this definitely the right track! I'll let you know how it goes!

      Thanks again
      Eldridge Felder

      Animation/Visualization Manager
      WorthGroup Architects

      Comment


        #4
        Mosel3y,

        I'm having an issue getting the Hit Component in my Break Hit to register. Could you provide a screenshot of your blueprints? Thanks again!
        Eldridge Felder

        Animation/Visualization Manager
        WorthGroup Architects

        Comment


          #5
          Make sure your collision boxes block the visibility channel, they don't by default. Mine are set to the "UI" collision preset. Sorry, I never mentioned that

          Comment


            #6
            Originally posted by Mosel3y View Post
            Make sure your collision boxes block the visibility channel, they don't by default. Mine are set to the "UI" collision preset. Sorry, I never mentioned that
            Man.. You're good. If I were rich I'd hire you tomorrow. Thank a lot buddy!
            Eldridge Felder

            Animation/Visualization Manager
            WorthGroup Architects

            Comment

            Working...
            X