How to make alternative actions

Hi, I am making a 2 players plot four or tic tac toe like game which is turned based so basically I wanted to make the player 1 to have its turn but then I wanted then it should automatically changes its turn to player 2.
Plz tell me how could i do this.

Try to use the once command

They are many ways to switch between players, it all depends on how you want it.
Using variables should help

Thanks but I have already implement trigger once and used variables as I have physics object like when the 1st(a) player block collide with ground change the variable to 1 and when the variable is 1 and player 2nd(b) block collide with the ground change variable back to 0 and when (a) collide with (b) change var to 1 and when (b) collide with (a) change var to 0.
So when I got the preview I got (a) block then (b) block as the (b) collide with (a) it change to (a) block so the next block is (a) but then it goes continuously on (a) block seems that the variable dosen’t changes any more.
Plz help

please tell some ways THE_GEM_TUTORIALS

Please send a screenshot of your events

1 Like

But are you checkig if the player is in collision with floor, before the player1block exists?

When I do first click p1 block exist from top and get collide with floor and then when I do second click p2 block get above it and then third click get back me to p1 block and then the problem comes, after third click the p2 block dosen’t come anymore and keep repeating p1 block, variable stops at 0 even my last p1 block get collide with the p2 block but then also my variable dosen’t changed.

Hi, THE_GEM_TUTORIALS here is the screenshot

So sorry for the late reply​:pray::pray:
From the screen shot above I think you should just keep your events simple.
I think you should delete the always condition and let the sub event stand as an event.
Also you should place the sub events of “touch or left mouse button is down”
In the same event with it (it makes it easier to track down the problem)

Presently I dont know what the game looks like so I would keep suggesting some events which should work.
Try adding this
Beginning of the scene
Change the scene variable “change” to 0

Thanks for replying, my game is just like tic tac toe or better plot four.

Could you send the project folder (DM) if you want it personal. That’s the best way I can help now cause I am not sure what the problem could be)