0 votes

I've created 2 instances and both are sharing the same function (or a nodes that acts on both, or variables, maybe? - IDK exactly).

I'm developing a puzzle game that everything moves by a timer, the blocks, the AI, etc. If some action happen, like a block falling or destroying, those timers stops, until the game is ready to resume. I have a function to pause (paused = true)those timers, and one to resume (paused = false). It works perfectly fine in single player.

But my idea is to make it multiplayer too, so I created 2 instances of this base, which works fine, but I noticed that when a block from a instance are destroyed or falls, it pauses both instances.

How to make those instances independent?

=========EDIT=========

Oh man. It was just me being stupid.

Think, doesn't make any sense to a node or a function or whatever in a packed scene control another packed scene in the same level if it's not explicit with a signal.

I tried to create timers on the code, created different timers, I put a lot of match on the code, and it never works.

So I start to look the whole code of the scene (just 600 lines + 600 of AI) and I found it.
One of the conditions to resume the timer is to check if a group "destroyed" still have nodes. So if a player destroy some block, if the other player drops a block for example, the clock of the second will resume only if the blocks of the first player are completely destroyed.

The funny thing is that this group are mentioned in only 2 lines.

It was fixed putting ("destroyed" + str(player)) when referring to the groups.

Godot version 3.2.3
in Engine by (105 points)
edited by

1 Answer

+1 vote
Best answer

I guess you are using signals to make timers paused ?
If so, than You should individualize those signals and connect them to specific timers.
If not, then show us this part of code

by (1,602 points)
selected by

I found the problem, I was using groups to resume the timers. I edited the post.
Thank you for your time

Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to webmaster@godotengine.org with your username.