Announcement

Collapse
No announcement yet.

VR headset Pawn/AI Tracking

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

    VR headset Pawn/AI Tracking

    Hey All,

    need your help! I am working with SteamVr/Vive, and currently have an AI that does a Simple Move to Player Pawn when spawned, and once it is close enough, it begins its attack list. The problem I am having is that the 'Player Pawn' doesn't seem to stay with the Headset/HMD.... so the AI just attacks the pawn object where it was placed at level start, which means you can walk around the AI and he is still attacking that pawn spawn location/not following the HMD as it moves around. I also setup a Rotator on an event tick for the AI, so that it always faces the player pawn, and have verified that, THAT works...but again the pawn/HMD seem to not be attached to each other.

    Am I missing something? I have the Player camera 'locked' to the HMD, so that part is setup correctly.

    Thanks!

    #2
    I figured out a simple/neat way to make this work if anyone is interested!

    Comment


      #3
      What was your way of making it work?

      Comment


        #4
        You need the camera location/actual HMD position instead of pawn location. You would also want a collision object attached to the camera that can interact with the AI.
        Michael Hegemann - https://twitter.com/HegiDev

        Marketplace Content
        Easy Multi Save
        Mobile Touch Navigation

        Comment


          #5
          How can you let the ai faces the player pawn? thanks!

          Comment


            #6
            Originally posted by kevinsir View Post
            How can you let the ai faces the player pawn? thanks!
            There is 'rotate to face blackboard entry' task in a behaviour tree.
            Marketplace: Vive Mocap Kit / Fingers Solver / VR IK Body Solver / Subtitles to LipSync / Dialogue System with Character Animation
            And random stuff at Youtube

            Comment


              #7
              Om,Can you give me some function to do that? I am new,and can not canculate it !

              Comment


                #8
                How did you make the location of the camera/headset public. At current my ai tracks the default vr pawn asset which results in it always looking for the center of the "scene" which in this case is "VROrigin". I was also thinking that tracking the headset would be better, but the ai is searching for a pawn.
                Consider supporting me on patreon

                Weapon Master and VRE Merge TUT

                Life Art Studios | Discord | End of Days - VR Zombie Survival

                Comment


                  #9
                  For working with EQS or AI, sometimes it is easier to make dummy blueprint actor, and tell AI to follow it instead of real goal. Then that actor can snap to real actor location (usually update on tick and just copy transform over and apply to self). This way i can have single EQS for bots, instead of branching and following different targets.

                  So to follow VR camera I made BP_marker that reads VR camera location and snaps to it:
                  - make BP_Marker, that is just empty blueprint
                  - in it on event tick find player pawn, cast to your player pawn class
                  - get camera reference, get its world transform
                  - save that in variable inside BP_Marker
                  - set transform for SELF to stored value (inside BP_Marker)

                  Make bots follow BP_Marker
                  Last edited by Nawrot; 01-03-2017, 03:44 AM.

                  Comment


                    #10
                    never mind I got it, here's how I did it. Let me know if I could do this better.
                    Click image for larger version

Name:	ai_example.png
Views:	1
Size:	208.7 KB
ID:	1120859
                    Consider supporting me on patreon

                    Weapon Master and VRE Merge TUT

                    Life Art Studios | Discord | End of Days - VR Zombie Survival

                    Comment


                      #11
                      Thank you for this info, I have been busting my head for a while before stumbling on this thread. Can you please share your method if it differs from the others? Thank you!

                      Comment


                        #12
                        Originally posted by Nawrot View Post
                        For working with EQS or AI, sometimes it is easier to make dummy blueprint actor, and tell AI to follow it instead of real goal. Then that actor can snap to real actor location (usually update on tick and just copy transform over and apply to self). This way i can have single EQS for bots, instead of branching and following different targets.

                        So to follow VR camera I made BP_marker that reads VR camera location and snaps to it:
                        - make BP_Marker, that is just empty blueprint
                        - in it on event tick find player pawn, cast to your player pawn class
                        - get camera reference, get its world transform
                        - save that in variable inside BP_Marker
                        - set transform for SELF to stored value (inside BP_Marker)

                        Make bots follow BP_Marker
                        what do you mean - set transform for SELF to stored value (inside BP_Marker)? I am making a VR game and needed to have the AI shoot at me right now the AI shoots off to the left of my VR pawn,

                        So far this is what I have Click image for larger version  Name:	1.JPG Views:	1 Size:	312.0 KB ID:	1587529Im stuck at the next step I dont know what set transform for SELF to stored value (inside BP_Marker) means
                        Last edited by PRESSURE2000; 02-22-2019, 12:16 AM.

                        Comment

                        Working...
                        X