sorry in advance for not knowing the community. im new at this in so many ways.
i created a dice rolling game in c# and unity and everything is working fine except for when player 2 attacks player 1 the attack value is not what it should be. and i think it is in this bit of code. but 2 hours of fooling with it has yielded no new knowledge. any help would be greatly appreciated. if more code is required kindly ask
i created a dice rolling game in c# and unity and everything is working fine except for when player 2 attacks player 1 the attack value is not what it should be. and i think it is in this bit of code. but 2 hours of fooling with it has yielded no new knowledge. any help would be greatly appreciated. if more code is required kindly ask
C#:
[COLOR=#0000FF][FONT=Consolas]if[/FONT][/COLOR][COLOR=#000000][FONT=Consolas] (PhaseName == [/FONT][/COLOR][COLOR=#800080][FONT=Consolas]"[/FONT][/COLOR][COLOR=#800080][FONT=Consolas]Player1AttackGet"[/FONT][/COLOR][COLOR=#000000][FONT=Consolas] || PhaseName == [/FONT][/COLOR][COLOR=#800080][FONT=Consolas]"[/FONT][/COLOR][COLOR=#800080][FONT=Consolas]Player2AttackGet"[/FONT][/COLOR][COLOR=#000000][FONT=Consolas])[/FONT][/COLOR]
{
DiceS1 = Random.Range([COLOR=#000080]1[/COLOR], [COLOR=#000080]7[/COLOR]);
DiceS2 = Random.Range([COLOR=#000080]1[/COLOR], [COLOR=#000080]7[/COLOR]);
[COLOR=#0000FF]if[/COLOR] (PhaseName == [COLOR=#800080]"[/COLOR][COLOR=#800080]Player1AttackGet"[/COLOR]) {
Player1ATK = DiceS1 + DiceS2;
Player1ATK = Player1ATK - Player2AddedDEF;
CombatP1On = [COLOR=#0000FF]true[/COLOR];
}
[COLOR=#0000FF]if[/COLOR] (PhaseName == [COLOR=#800080]"[/COLOR][COLOR=#800080]Player2AttackGet"[/COLOR])
{
Player2ATK = DiceS1 + DiceS2;
Player2ATK = Player2ATK - Player2AddedDEF;
CombatP2On = [COLOR=#0000FF]true[/COLOR];
}
}
RollDiceButton.interactable = [COLOR=#0000FF]false[/COLOR];
NextPhaseButton.interactable = [COLOR=#0000FF]true[/COLOR]; [COLOR=#000000][FONT=Consolas] }
[/FONT][/COLOR]