How do i make a random character selector

i want to make a button that when you press it will load you with 1 of 4, of the character and i dont know if i have to use a random or a router thing.

please use my game as an example
my game: https://flowlab.io/game/play/2112273

I believe you have to use both

but how and where do i connect it

You already have the system in place to spawn in the character, all you need now is to pick a random on like this

i can make it a diffrent key bind right?

1 Like

when i done that code it worked with the random character but im still in the menu and the character spawns fall and keeps on the health and coin labels

Yes,

You need to send a message to the controller like in the characters

when i done that code it worked with the random character but im still in the menu and the character spawns fall and keeps on the health and coin labels

What?


You send this message to the controller to move onto the next level, so when you select a random character you must send this message for it to leave the menu

How did you understand that???

1 Like

Practice helping a lot of other people

i dont understand like where do i connect it and how do i send a message to next level

If you look inside your “player 1 select” (or any of the other selectable characters) object you can see you are sending a Message titled “Player selected” to the “Controller” object. When the message is received you will move on to the next level.

You can do the same thing in your object selecting the random character (So all you need to do is send a Message)

like this?

1 Like

Yes that should work (just make sure you are sending the message to the correct object)

its correct but its only spawing player 1 which is the girl

It spawned players 3 and 4 for me, I think it was just random that it spawned player 1.

never mind it works i just have bad luck lol

but is there a way that each character like have a chance to be chosen instead of mostly all getting player 1 like playing for 4 time with the same player then the random says it wants to change but i want it like atleast evenly spread out the chances of 1 of the 4 characters