Announcement

Collapse
No announcement yet.

PawnSensing OnSeePawn not firing

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

    PawnSensing OnSeePawn not firing

    I'm trying to get an enemy to sense when a player character comes into sight, and at the moment am unable to get the PawnSensing component to register at all.

    I've added the component to a Character, and also unchecked "Only Sense Players" as my game's a RTS-style thing and so the player is controlling an invisible camera with their units represented as other Characters, I have also increased the Peripheral Vision Angle to make sure it wasn't a problem with that.

    What I've not been able to do is set "Parent Socket" to the socket I've created in the head of the skeleton, I'm unable to either type into the box or drag the PawnSensing component to be a child of the Mesh.

    Click image for larger version

Name:	Sensing_ComponentView.png
Views:	1
Size:	47.9 KB
ID:	1134759

    For an event graph I have the simplest thing I can imagine- simply print when you see something. Anything. But at the moment I'm taking my player-controlled units, bringing them round a wall, and running them round the enemy, all with no message being printed.

    Click image for larger version

Name:	Sensing_EventGraph.png
Views:	1
Size:	19.6 KB
ID:	1134760

    I think I've missed something obvious but can't think what it is.

    #3
    Originally posted by PenguinTD View Post
    Is your enemy character inherit from an AIPawn Class?
    It's a Blueprint with "Character" as parent, I can't see any AIPawn class to use here.

    Comment


      #4
      Sorry, I'm an idiot.
      There is only AIController, no AIPawn.

      Back to the topic, I can make it sense my character relatively easy, and print hello when it sense my presence.
      You just have to make sure your controlled character is inherited from a Pawn or Character class, check it with blueprint properties.
      Unreal Engine 4 Game Framework diagram for relation of all major base object types
      Unreal Engine 4 Input Event diagram, scroll down to section Input Processing Procedural
      Resident Evil Classic Camera
      RPCs official document, Must Read
      Everything you should know about replication

      Comment


        #5
        Ah, it was the AIController.

        Both Player and Enemy did inherit from Character, but the Enemy didn't have an AIController associated with it- and I didn't know it needed one for this as I thought they were for more complex control setups.

        Thanks for the help, much appreciated.

        Comment


          #6
          So I am having the same issue with the OnSeePawn event. It just does not appear to be firing when my player character walks into the "look" zone. I've set the collision on the player to block all in every place i can think.

          My bot controller is based off AIController, and my bot is a character BP with the AI set as the bot controller.

          Click image for larger version

Name:	AI_Pawn.PNG
Views:	1
Size:	240.1 KB
ID:	1053742 Click image for larger version

Name:	AI_Pawn_char.PNG
Views:	1
Size:	79.7 KB
ID:	1053743 Click image for larger version

Name:	AI_Pawn_prop.PNG
Views:	1
Size:	45.3 KB
ID:	1053744

          Comment


            #7
            Bump: Needing help with this also.

            Comment


              #8
              Bump for goodness....

              Comment


                #9
                You need to enable Pawnsensing with a "set sensing updates enabled" node (also make sure you enable the enable bolean in that node) in the construction BP for your AI controller.

                Let me know if that helps

                Comment


                  #10
                  Hey everyone! I would like to offer the solution that worked for me.

                  In your pawn where you are trying to use the OnSeePawn event, make sure "Auto Posses AI" is set to "Placed in world or spawned". Like so:

                  Click image for larger version

Name:	UIEYZRQ.png
Views:	1
Size:	16.6 KB
ID:	1088158
                  WZRD

                  Comment

                  Working...
                  X