[Solved] Help with my roof

Please help.

I need ideas on how to do the following with the visibility of my roof. I don’t want to use many objects for just the roof.

here my project: and my problem explained

techo002 techo003

give pictures and description please.

I already put the photos but I think my project explains my problem better. I appreciate the help.

I don’t think. it doesn’t matter, I’ll guess.

  1. if you are worried about the lenght of your code, you can use object groups. and you can use as much object as you want. I recommend you to learn much about this, because it is a super useful function is GDevelop. but in this case we can do without it .

  2. if you dont want too much object, you can do it with only one. suprisingly the code is the same:

if I understand correctly what are you want.

1 Like

Thanks a lot. I see later your idea with more time. And i tellyou

Both solutions work. It never entered my mind. Thanks for your time.

How is it possible that a sub event cancels an action that is always supposed to act?

It is assumed that the “topdown movement” behavior is not deactivated at any time.
Why is it canceled with the sub event?

my head explodes.

it is nothing else, but the order of the events. order is always important.
the topdown movement condition, or its action the “show object” isn’t deactivarted. actually its executed all the time when you move the player object. but after that, the subevent is executed too. this cycle is so fast, you can’t see. actually, the whole process repeating 60 times per second (or 30 times per second depends on the setting) until the player object move. and the show object action is executed on all the intances no matter it’s visible or not at this moment. this is not problem, when you haven’t too much from them. in this example you have 4 of them, thats why I used this method now. but if you want to place 400 roof block in one scene, I do not recommend this version.

1 Like

It’s exactly as you say and I put it to the test in my real game with lots of events. And your solution works only as a sub event (as a separate event it doesn’t work)

But instead in the simple example of 4 roofs as a separate event they work well (both options)

I will have to record the order of events as a general rule from now on.

Thanks for the explanation and your solutions.

Works perfect:sunglasses:

yes, it needs to be a sub event, but it’s ok.

its not clear for me, are you done with this function?

1 Like

Works perfect.Thanks a lot

1 Like