Announcement

Collapse
No announcement yet.

Same AI moves to 0 instead of chasing the player when reused in a different game

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

    Same AI moves to 0 instead of chasing the player when reused in a different game

    Hello there,

    I am new on Unreal and BluePrints and I have implemente a simple AI that chases the player following a tutorial on internet. It is this one:
    Click image for larger version

Name:	ai.png
Views:	45
Size:	72.7 KB
ID:	1733083



    Now, I started a new game and I was trying to reuse the AI but it simply goes to the 0 position. I assume that what is happening is that there is something wrong with the function "Get Player Character" and the AI simply goes to the default destination. Does someone know what can be the issue and, more important, how to debug similar problems when programming with BluePrints?

    Thanks for the help!

    Regards,
    Raul


    #2
    Hi Raul, I'd suggest making sure that the "Default Pawn Class" in your Game Mode is set to your Player Character class. Without it, the AI will move to the 0 location. Also, for debugging purposes you can click on the AI Move To node and press F9. This will cause the execution to stop at that point and you can verify the values of all incoming variables.

    Click image for larger version

Name:	debug.jpg
Views:	55
Size:	333.9 KB
ID:	1733226
    Unreal Possibilities
    Grid Creation Systems | Tower Defense Starter Kit | Floating Damage Texts

    Comment


      #3
      Hi Stormrage256,

      Thanks a lot for the help. I have been reading a bit and using the debug features that you pointed and I solved the problem by replacing "Get Player Character" with "Get Player Controller".

      Regards,
      Raul

      Comment

      Working...
      X