unique id please help

You are working on a network game on native platform ?

To create unique ID, using object variable “ID”, just create a variable object so called, and let the value to 0 by default.
Then create an object counter global variable, for exemple “playerCounter” and set it to 0 to.

In “scene startup” condition, you’ll create your player object instance,
in a “for each object ‘player’”, action : player.Variable(ID) = GlobalVariable(playerCounter)+1 then
then increment the counter : GlobalVariable(playerCounter) = player.Variable(ID)

This way all object “player” will have a unique “ID” value in variables, that you can use for all other condition.

Hope this will help, i’m not sure about the purpose if you are using network extension, idk how does it work, and probably client game can’t share “local” variable…

1 Like