I’m facing an unusual problem with my AI character. When I add the prefab directly to the scene using the editor, it runs smoothly. However, when I try to create the same prefab during the game, the AI misbehaves.
The main issue arises with the ThirdPersonCharacter script linked to my AI. The character stays stuck in the idle animation and won’t transition to walking. I pinpointed the problem to the “CheckGroundStatus()” function where this line causes a failure:
animatorController.applyRootMotion = false;
Instead of transitioning to the walking animation, the character slides along the ground as it moves to its target. It seems like the ground detection is malfunctioning, but I can’t understand why the prefab would act differently when it’s added via the editor versus during runtime.
I’m using the standard AI setup provided by Unity. Has anyone experienced something like this? What might lead to such different behavior between editor placement and runtime instantiation?