Timing problem...need help

hey there peepz…long time no see,
i keep developing my game.
Now i’m stuck on this little problem,

I try to explain…:
basically 2 red balls collide at the same speed, and at the same time with a blue square like in the pic.
I want that only one ball get assorbed in the square (without using object variables! or change their attribute in any ways).
.
I tried with the pick conditions without success.It looks like GD cant get 1 ball since he put both in the square…
Someone have a hint?

Why can’t you use object variables? You could just have a boolean object variable for each set of balls called “passThru.” Then set one of them to true for each ball group.

1 Like

I cant use object variablers since i made a custom spawn system that if possible idon’t want to go back to edit.
But even so how do you check which ball to get absorbed if at the Exact same time they hit the box?

I don’t think you would need to change much if you were to add object variables, it’s hard to tell without seeing the events/knowing what you’re trying to do.

For every set of two balls one would have “passThru” set to true. When they collide with the box, you would have a condition that checks if their object variable “passThru” is true, if it is true then they can pass, if it is false, then they would not pass through.

1 Like

as i said i juyst want one to get absorbed not every balls who get in contact, and they are all the same

The same logic applies, Just use the pick random object condition/event and set its “passThru” to true, the others can remain false. You wouldn’t have to change any of your previous code.

1 Like

thaz what i did… but when they collide GD put them both in the box cos they hit at the same times and it seems that he cannot recognize in time which one to pick

Yes, but it sounds like you weren’t using object variables then.

1 Like

It seems i have no option then…
thx for the replies

Literally all you need to do is:

  • Give balls boolean object variable “passThru” and set it to false
  • Pick a random ball and set passThru to true
  • When balls collide with box, check if passThru is true, let it pass
1 Like

it is what i did but with collision and didn’t worked…ofc…
gonna try now with var

both get absorbed i wonder if its a “trigger once problem”…i’m cheking…

It doesn’t work…
because i have conditions “FOR EACH” and i can’t isolate the pick one action, since i guess its repeated for each object…

Here is a quick demo game I created to show you how this works.

1 Like

its not what i need,
you are assigning the var at the beginning while the balls move during the game and collide at certain time, the var should be assigned on collision and not at the beginning.
And it doesnt work becouse i put conditions for each object since they have enemy AI

It would be more helpful if you described in detail what you’re trying to do, with screenshots of the events and objects instead of vaguely describing the mechanics.

1 Like


Eg…
if i use your condition and the ball below is picked i cant absorb the one on the platform.Balls are moving and doing things oin the game,
when the boix collide with one it will absorb.
But if 2 balls collide simultaneously i want just 1 to be absorbed

1 Like

ok gonna try this…
hope it’ll works