Taking Cover System work

Started by
2 comments, last by Ianuarius 5 years, 7 months ago

Hi.

I want my enemy characters can take cover behind obstacles. i use unity engine and for do that i added two trigger at left and right of obstacle like below picture. also i wrote some code to find these triggers and after found closest of them move to it and play take cover animation. but some times after come to trigger, it don't work correctly. seem some part of my work is incorrect and i need know this way is correct or not? if it's not correct dose someone can explain me how do that?

Thanks.

001.png

Advertisement

Hi,

what exactly is not working?

Also, if you move the player to a point in cover, why do there have to be triggers?
You should know the distance to the target point and handle the game logic from there.
A navmesh agent in unity also knows the distance it has left to travel.

Debug. If you don't want to do it with Visual Studio, you can even just expose some variables related to the action and see if correct flags get triggered, if numbers look good, etc. If something doesn't happen, then you know what needs fixin.

This topic is closed to new replies.

Advertisement