AI doesn’t work after packing games,However, the test succeeds in the editor,Why?This problem has been bothering me for a long time. Is there something about the engine that hasn’t turned on?
I’m not sure I have the answer, but might I suggest adding your asset directory to this array in the Project Settings window?
Can we get a few more details? Is your project a C++ or blueprint based project? If it’s a C++ project, can you share the contents of your [Project Name].build.cs
file with us?
Try it in your own way, and the problem is still there.
In your project folder, under Source/[Your project name]/
there should be a file called [Your project name].build.cs
. This file defines module dependencies for your project. Can you please post the contents of that file and we can see if you’re missing the AI module.
// Fill out your copyright notice in the Description page of Project Settings.
using UnrealBuildTool;
public class FlyandShoot : ModuleRules
{
public FlyandShoot(ReadOnlyTargetRules Target) : base(Target)
{
PCHUsage = PCHUsageMode.UseExplicitOrSharedPCHs;
PublicDependencyModuleNames.AddRange(new string[] { "Core", "CoreUObject", "Engine", "InputCore" });
PrivateDependencyModuleNames.AddRange(new string[] { });
// Uncomment if you are using Slate UI
// PrivateDependencyModuleNames.AddRange(new string[] { "Slate", "SlateCore" });
// Uncomment if you are using online features
// PrivateDependencyModuleNames.Add("OnlineSubsystem");
// To include OnlineSubsystemSteam, add it to the plugins section in your uproject file with the Enabled attribute set to true
}
}
Please take a look at it for me,thank you.
I added AIModule, but the problem is still unsolved.
In the editor, AI works properly, and after packing, AI does not move in the game
Did you add AIModule to the PublicDependencyModuleNames
or the PrivateDependencyModuleNames
? Hmm, if adding AIModule didn’t help then I’m out of ideas sorry.
PublicDependencyModuleNames
Can someone help me?
Thanks for your help,I solve my problem,I cheak the log file and find the key!
The key to the problem is this
After DEL this code ,My AI works fine
I don’t suppose this works for you, does it?
Also, I assume you’re ai character/pawn is being automatically possessed by the AI Controller Class defined in the details panel, and not being overwritten anywhere else?
Double check these options in the details panel, and ensure that they suit your needs.
Have you also tried printing a debug message on EventPossessed() ?
Finally, if you take a look in Build>WindowsNoEditor>YourGameName>Saved>Logs and read through and search (ctrl+f) for any key words relating to your AI character, errors, warnings and failures, then you might find the source of your problem there.
Good luck.