- Home /
Nav Mesh Agent
Hello Everybody , It's like a problem adding a trigger to player so when enemy gets into that then it will play attack animation , but what if it will make a little distance like player is walking and enemy is following and in a very short distance it's getting a problem like trigger in/out every short time and the enemy is never playing single animation simultaneously, Enemy is like playing half run and half attack animation , That's why i need help to know how to write code about - if enemy will reach stoping distance in nav mesh agent built-in function ,then it will play attack animation . please make it simple , thanks .
Why don't you simply make the trigger bigger ?
You will have the same problem by comparing the Nav$$anonymous$$eshAgent.remainingDistance with the Nav$$anonymous$$eshAgent.stoppingDistance distance.
I used RAIN AI when making AI. I didn't regret it. I dumped all of my AI scripts (which took me a few weeks to write) for logic which can be created in 10 $$anonymous$$utes with RAIN as soon as I downloaded it.
@Hellium , $$anonymous$$aking big trigger cause the problem again , because it stuck when it will try to play attack and stop there . so making trigger big is not a great idea . But thanks for telling me functions i will try to compare them .
@Wolfdog i know Rain is good but i want to make this game totally with built in unity functions . I will use Rain in my 2nd project soon when i complete my first one .
how can i compare those , there is not any function like " Nav$$anonymous$$eshAgent.remainingDistance with the Nav$$anonymous$$eshAgent.stoppingDistance"