Announcement

Collapse
No announcement yet.

Calling the AI Move to Location/Actor node

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

    Calling the AI Move to Location/Actor node

    Hi.
    I'm trying to use the Move to Location/Actor node but just wasn't sure how to call it. I've seen examples where the Set Timer By Event node has been used and then is called every 2-3 seconds.

    Is that the appropriate way to use it instead of hooking it up to a tick event?

    Thanks
    Attached Files

    #2
    It depends on how you want the event to be called if it's say an enemy then you can set up a pawn sensing component that when it sensors the player it triggers the ai to move. Maybe send some more details so we can help

    Comment


      #3
      hi!
      I've been following this serie of tutorial https://youtu.be/sbV7MT1nn28 In the first couple of episodes you have infos about the AiMove to linked with visual (and later auditory) perception. You can also have the npc walk randomly around and wait or follow a spline. Hope it helps

      Comment


        #4
        Thanks Deftones4 and Ricolas71. The other thing I was unsure about is the use of a NavMesh - and whether this is necessary for the AI Move To Nodes?

        Comment


          #5
          I believe you have to have a nav mesh for the ai to move. When I've done NPC's or enemies I create a enum so I can switch to different modes that I want the ai to be. Also you should be using the ai move to node

          Comment


            #6
            Great. Thanks. Last thing. Trying to increase the speed of the AI controlled enemies - I know the max speed can be set on the movement component. Just wasn't sure why what I have done by multiplying the current velocity/vector by a scalar isn't just increasing the velocity of the ai controlled pawn. Thanks.
            Attached Files

            Comment


              #7
              It looks to me that you are increasing the speed as soon as the Event begin play is fire i would place a print sting and try debug your speed. I have never done it that way before i always increase speed from the character movement component

              Comment


                #8
                Velocity. The way you are calling it is basically setting velocity to zero and you only are doing it one time. Velocity is the actors speed, but it is typically not something you set, rather get. Not that you cannot set it, but in AI, it will not remain that value. The AI will move based off the character movement component. If Max speed is 500, that is as fast as the AI will go, even if you set its velocity. Essentially, every tick velocity is being updated. It is not typically used as a means to set bounds, rather a check to see if the character is behaving within its bounds or maybe a starting velocity of a physics actor. Setup your AI Character movement component with the params you want. If you want to change params, like sprint if you are X away from Target, you can by getting the controlled pawn of your AI controller casting to the AI char, and setting the movement component params.

                NavMesh IS REQUIRED. For any AI movement, event the simple move to node, you need a NavMesh...unless you program your own complete navigation system.

                Calling Move To Actor/Location on tick is wrong. Do not do that, here is why. This node sets the destination to a location or actor to an AIC. The AI moves and then checks on "tick" to see if it has reached its desired location. If not, it continues to move until it does. Setting it every tick does nothing but set the same variable to the same thing every tick. Only call this when you want to change the AI destination.

                Acceptance radius -1.0, I don't think that calculation is possible.

                Comment

                Working...
                X