Hello everyone, I’m making a war card game already made the cards shown on the table when the player wishes, gave the cards values, but I can’t figure how do I create a script that, every draw of cards, determines which card is higher …
right now the script is connected to the player and the rival’s scripts, but how do I get values from cards the are created randomaly
Like any embedded game property, the traditional Unity way is to create a script (which implies it derives from MonoBehavior) that every card has on it, and that script contains at the minimum a public field that has the values you are interested in.
That script might also have a way of doing extra logic, such as doing the actual comparison between two or more cards , in order to centralize logic about such things in a single location.