Im making a game where the player can create their own platforms using prefab clones but i want to limit the amount of clones the player can make. If you could help out that would be great.,Im making this game where the player is about to create their own platforms but i dont want that to be infinite. If you have any idea how to do that please help. Thanks!
How do i limit the amount of clones of a prefab a player can make?,How woud I limit the number of prefab clones created?
I would instantiate the clones into a List of objects. And just check the count of the List when instantiating to see if you are able to or not.
List<GameObject> objs = new List<GameObject>();
int maxObjs = 10;
if (objs.count < maxObjs)
If I was setting this system up I would create an int, maybe…
public int platformParts;
…and every time you build a platform call…
platformParts = platformParts - 1;
Then have an if statement for the build platform function like…
if (platformParts >= 1)
This way you can have the player collect more “platform parts” by cutting down a tree cough fortnite cough and upon that action just …