I want to set some penalties (layer cost) for different players.Assume that there are 2 players A and B and there is an area named area66. When i calculate a path that penalty on area66 will be considered for player A units but not for player B units.Is there a solition without using two different layers?. If there is 8 players or more it should work fine.
Your being a bit obscure here.
A) you want 2 - 8 players.
B) you want an area (trigger) that has a movement modifier
so…
C) you need to develop factions rather than just player names. (factions have far more uses)
D) the trigger’s script needs to contain a function MovementModifier(faction : String) that gives the movement modifier for that particular faction.
E) in your player’s movement script, you need a “MovementModifier” variable (this variable should be a List, very important)
F) in the trigger, you need a piece of code that adds the GameObject to the List. When he leaves it removes it.
G) in the players movement script, you simply reference last item in the list’s GameObject’s trigger script and get the movement modifier from it.
Thank you very much BigMisterB, i did exactly same thing with your answer.I put some restricted areas with team related tags and while calculating path i calculated them also.