Saving Agent Nolan and dragging into scene does not act like demo?

kentreva

Member
Hi! Posting here after emailing. Hope to continue the discussion here.



I saved the Agent Nolan as a prefab and dragged it into my own demo scene. But it doesn't move? It just stays in this still position with no animation playing seems like.
Also if I run into it, it slides, as if it's like a box.

Gif google drive link: https://drive.google.com/file/d/1i6PcvyPJKAIQZojYb_YHNlKrYnN1IK2c/view?usp=sharing

This is all in the same project.

Is there some external thing that triggers the enemy to behave the way it does in the demo scene?

The player character works. Just the enemy is not moving like in the demo scene.

Here's the console. No errors.
This particular highlighted message is linked to the player Nolan game object, not the Agent Nolan.
1653095304504.png
Agent Nolan game object:
1653095577919.png
1653095318880.png
 
Based on the components in your screenshot there is nothing there to tell the agent to move. You should add the behavior tree component to it or use some other method:

 
Oh ok. Just curious, If this was saved as a prefab from the demo scene, how is it not moving? Because the one in the demo scene is moving side to side. Is the behavior tree component external from the game object?
 
The melee agent script is just for demo purposes, and moves the character in a very specific way. The reason it is not moving in your scene is that you have not baked a NavMesh to your scene (see first warning message in your screenshot).

Behavior Designer is a separate product from Opsive to control AI characters in your seen.
 
How is that error message showing if there is no NavMeshAgent script attached to the AgentNolan object? Sorry if it's a dum question, I'm new to this navmesh stuff.
1654055720827.png
 
Sorry, the error seems to come from another character in your scene. AgentNolan is only moved by the animation clips, so the logic is hard coded into the animator controller. The agent movement only starts when the player character is close to the agent. This is controlled by the melee agent script.
 
Ah i see. That error is coming from the player seems like cause it has a navmesh agent component.

Sorry back to the original question. Why isn't the agent nolan working like in the demo scene despite being copied as a prefab from the demo scene?
I've attached a unity package with a sample scene (named AgentTest) where the agent isn't doing anything.
- The agent doesn't attack when the player gets close
- The agent does not move side to side like in the demo scene.

Really apprecate if you guys can look in the scene and let me know why.

https://drive.google.com/file/d/1uXBBaW1OiphtnBsAxySa6eRPdJtU2qGb/view?usp=sharing
 
The agent is not moving because the melee agent scripts disables the agent movement ability upon start. The character does not attack because the melee agent script disables the script itself. When you enable both after start manually, movement and attack work fine.
Again, the melee agent script is intended for the demo only, not for any other use.
 
Oh I see. The attack public method of the MeleeAgent script is being called externally by the demo scene.

I've called the method and it now works as expected.
 
Top