Secret/Invisible Area Example - Easter eggs! 🥚

Hi! I’ve already shared this example and is featured on the examples page, but I just updated it with a new level and option for secret areas. :wave:

Inspired by other games, the Example now has two options for secret areas:

Level 1 = Proximity reveals secret area.
Level 2 = Collision reveals secret area.

Click the arrow for the Level 2 option.

secret area 2 - Samuel Tomé


A bit late for easter eggs, but now you can also add more secret areas/easter eggs on your game! :egg: :blush:


Interesting. These both work in different ways, but only use one extra object… Do you think there’d be another way to make this without using proximity or collision? Maybe use a custom proximity bundle to make a system that works like the proximity one, but doesn’t cause any lag…

This is very cool.


Thank you for the idea now I’ll put these everywhere in my game when I get indie.


XD. It doesn’t take many objects.

1 Like

no I mean after I make levels because having no indie puts me at a level cap so I pack my game full of features without levels to use the features. here’s my game check it out Monster County

1 Like

This is already pretty optimized to not cause any lag, check it out! :blush: The code has InView behaviors and such, and it’s pretty adjustable if needed.


Awesome! You go! :fire: I can confirm that indie is cool indeed :slight_smile:


If you’re looking for optimizations you can use player Globals instead of a proximity. If you wanted you could even have the player send the X/Y on collision so the Globals aren’t constantly active (though it doesn’t matter much because they wouldn’t trigger the code, so it’s a very very small change on performance).

You can also condense the 4 expressions down into 1 if you’d like as well.

But the proximity and expressions only go off for a single frame, so you might notice a slight lag spike if it’s a weak device, but otherwise it should be alright


The second level looks cool, but is there a way it can be optimized for there to be multiple secret areas in a level?

1 Like

If the areas aren’t close to each other, you can use In-View. If they’re both on screen at once, you can raycast and send messages. Then just repeat that in a chain (and ofc don’t activate the ones already hit)

1 Like

Yes! For sure you can also use Player XY globals, but I kept this example as simple as possible for newbie users - so its easy to copy and paste
But its pretty versatile and adaptable as codealpaca suggested.

As always there’s many ways to do the same thing. here are a few ways you could do that:

  • Use and extract Object names to determine which area they belong to: If the name is “2” they only trigger if another “2” object has been triggered.

  • Use another object that stays on top of secret areas nominated of something like “Secret Area 1”, on game start they check proximity just once to confirm which area they belong to. And assign that number to their logic, probably using a Filter.

  • In-View behavior can also make this work, but it could also become weird if the secret area is not always on screen.

  • CodeAlpaca suggested raycasts, but that sounds like a lot of work and not performance-friendly

You could also go even further and just straight up not use any proximities, and use the Distance Bundle and Lists for the “Secret Area 1,2,3…” XY instead.

1 Like

Ray casts would probably be better than proximity set to 600 or at least about the same, I just thought naming everything “1” or “2” would be more tedious lol. Just 4 (or 1, just change rotation) very small RayCast(s) are needed. I guess it would be slightly harder for a new user (Than the current proximity), but newer users should learn how Raycasts work anyways.

Creating a secondary object as well seemed unneeded to me, might as well just create a 2nd invisible wall object


Ah true true @Kasamir The easiest way is to just have different object for different secret areas per level.
You could have 5 objects all with their Parent set to the original “Hidden Area” object.
They could probably send a message to self to set the Filter, to only activate on that area.
And you could use those 5 objects across all your levels too.
That’s for sure the easiest less work way, and is still super performance friendly :+1:t4:


This is great! I’m using it in my new game, and it works so well!

Do you want me to add you to the credits, @Samuel_Tomé_PixelPizza?

1 Like

That’s awesome! I’m glad you like it! @JUSTPLAINOP
I’m curious to see how it looks - feel free to share a gif/image or video here to show us :eye: :eye: :fire:

No need to credit me, but if you want to - that’s fine too :slight_smile: It’s up to you!

1 Like

Well the only thing about indie that’s bad is lack of mobile options and that whenever I get it I always feel unmotivated and I’m less creative and I stuff my game with objects because I don’t have a limit.

It looks so good!

1 Like

That looks great!!! Awesome :blush: @JUSTPLAINOP
I’m glad the example is being put to good use.
I really like the game’s overall vibe too, you go!

1 Like

Oh I never thought that you had other textures I might use them in a small project.