Hello. I have this worked out that when I do my bite animation, If my sphere collider hits an animal, I get a message (I will replace this in time with the actual eating) So far I only have 2 animals imported and set up. The cow and the gator. Both do exactly the same thing right now, which is wader until I get close then chase me and both share “prey AI”
My problem is when I do my bite attack, I am using “cast to cow_character” and its capsule collider, or “cast to gator_character” to detect if I land a hit. general enemies if I land a bite or not. Id like each enemy to have its own reaction to the bite (such as taking damage and dying, or being swallowed
You can use a sequence node and cast multiple times but it’s not recommended because if you add 10 more characters you would have to cast to them all again.
If you need access to the capsule component you can cast to Character as all characters have a capsule component.
When you attack you should use Apply Damage node. Then in your AI create Event Any Damage. There you can setup what happens for each character when they are damaged.
Or you can learn about interfaces and use those to communicate with your AI and tell them that they were damaged and how. This method is a bit more advanced and doesn’t require casting at all.