SetDestination doesn't work after building (with images) answer please
In my game, I can move a selected character with the right click. Every single unit has a NavMeshAgent component, and in the Editor, while the game is running I can move the selected character with "SetDestination(mouseHit.point);" (mouseHit = RaycastHit). Everything works perfect, but when I build my game, I can select my units but not move them with the right click. It's like it doesn't recognise the mouseHit, or it doesn't recognise the NavMeshAgent attached to the character. I have some images: I used LineRenderers to show the where's the mouseHit.point or the destination:
After Building: (Can't move)
In editor (Can move correctly)
By the way, red spheres are enemies. They spawn every 2.5 seconds and YES I can attack them after Building my game. It means: **I CAN ATTACK AFTER BUILDING MY GAME, BUT I CAN'T MOVE.
Please help me. Thank you.