UCC

Super Tom

New member
How to use UCC to create an enemy AI's attack capability
I have a very tall monster model, and now I have the basic abilities, similar to boxing, I want him to have the attack ability to cause damage to players
 
1679562530431.png1679562559693.png
I have reviewed and used the AI of (Artificial Intelligence (AI))in the official document to cause damage to players, but there may be errors
 
Is that the first error? m_Transform is assigned within Awake so as long as your health component is on the agent then it'll be assigned correctly.
 
Yes, this is the first error. My character also has a health component,which has been bothering me for a long time
 
Ah, since PUN instantiates the character the character may not be spawned yet. In that situation you should not call damage within Start, you should instead call it after the character has spawned.
 
Ah, since PUN instantiates the character the character may not be spawned yet. In that situation you should not call damage within Start, you should instead call it after the character has spawned.
I tried, but I couldn't solve my problem. There are no errors now, but nothing has happened
 
Ah, since PUN instantiates the character the character may not be spawned yet. In that situation you should not call damage within Start, you should instead call it after the character has spawned.
I tried to add some of the same things to my AI as in the demo, such as abilities, animations, events in animations, and items. In the item, I created a new item named punch, and then added a collision body, and then added a code that causes damage to the player. Everything was ready, but it still didn't work
 
Ah, since PUN instantiates the character the character may not be spawned yet. In that situation you should not call damage within Start, you should instead call it after the character has spawned.
What makes me feel strange and shocked is that the AI in your demo can do harm to me very well, while my own cannot do harm to me.
 
I recommend placing a breakpoint within the Health.Damage method and tracing what is happening. This will ensure you are calling the method on the correct reference.
 
Top