Results 1 to 4 of 4
  1. #1

    Default Problem with State

    Hi im making testings with AI in UDK and when i run the code for the follower pawn it crashes and don't start the game.

    Here´s the code
    Code:
    auto state Follow
    {
    Begin:
    	Target = GetALocalPlayerController().Pawn;
        	
    	MoveToward(Target, Target, 128);
    
            goto 'Begin';
    }
    Note: If i quit the goto code it runs but obviously that's not the point.

  2. #2
    Iron Guard
    Join Date
    Nov 2006
    Posts
    712

    Default

    You are creating an infinite loop there.

  3. #3
    Iron Guard
    Join Date
    Jan 2011
    Location
    Netherlands
    Posts
    738
    Gamer IDs

    Gamertag: ColdGuy

    Default

    Quote Originally Posted by Dazel_Hirae View Post
    Note: If i quit the goto code it runs but obviously that's not the point.
    Obviously it is :/

    There are alot of tutorials and sample scripts for making AI walk towards a target. Did you look at any?

  4. #4
    MSgt. Shooter Person
    Join Date
    Nov 2009
    Posts
    104

    Default

    if MoveToward() exits immidiately, then you create an infinite loop (such as if the local player controller doesn't have a Pawn yet). Add a Sleep(0.0) after MoveToward just to be safe


 

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Copyright ©2009-2011 Epic Games, Inc. All Rights Reserved.
Digital Point modules: Sphinx-based search vBulletin skin by CompletevB.com.