# Secret/Invisible Area Example - Easter eggs! 🥚

**URL:** <https://community.flowlab.io/t/secret-invisible-area-example-easter-eggs/42648>\
**Category:** Examples & Tutorials\
**Created:** [April 1, 2024, 10:20am UTC](https://community.flowlab.io/t/secret-invisible-area-example-easter-eggs/42648 "2024-04-01T10:20:11Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![Samuel\_Tome](https://community.flowlab.io/user_avatar/community.flowlab.io/samuel_tome/32/71675_2.png) [@Samuel\_Tome](https://community.flowlab.io/u/Samuel_Tome)\
**Post date:** [April 1, 2024, 10:20am UTC](https://community.flowlab.io/t/secret-invisible-area-example-easter-eggs/42648/1 "2024-04-01T10:20:11Z")

</div>

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. 👋

## 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._

> **[Flowlab.io - Secret/Invisible Entrance Example](https://flowlab.io/game/play/1575660)**
>
> Use \*\*WASD\*\* to move The Logic is inside the \*\*Secret Dirt\*\* or \*\*Secret Stone\*\* object Click the arrow for the Level 2 option. Level 1 = Proximity reveals secret area. Level 2 = Collision reveals secret area. Want to give your...

![secret area 2 - Samuel Tomé](https://community.flowlab.io/uploads/default/original/3X/c/b/cb448f9f9c52deb7fba70702a3d0579e60c3e5d9.gif)

Enjoy!

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

---

<div class="post-metadata">

**Author:** ![JUSTPLAINOP](https://community.flowlab.io/user_avatar/community.flowlab.io/justplainop/32/62091_2.png) [@JUSTPLAINOP](https://community.flowlab.io/u/JUSTPLAINOP)\
**Post date:** [April 1, 2024, 3:50pm UTC](https://community.flowlab.io/t/secret-invisible-area-example-easter-eggs/42648/2 "2024-04-01T15:50:59Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![B00T987](https://community.flowlab.io/user_avatar/community.flowlab.io/b00t987/32/70321_2.png) [@B00T987](https://community.flowlab.io/u/B00T987)\
**Post date:** [April 1, 2024, 4:59pm UTC](https://community.flowlab.io/t/secret-invisible-area-example-easter-eggs/42648/3 "2024-04-01T16:59:33Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![JUSTPLAINOP](https://community.flowlab.io/user_avatar/community.flowlab.io/justplainop/32/62091_2.png) [@JUSTPLAINOP](https://community.flowlab.io/u/JUSTPLAINOP)\
**Post date:** [April 1, 2024, 5:00pm UTC](https://community.flowlab.io/t/secret-invisible-area-example-easter-eggs/42648/4 "2024-04-01T17:00:30Z")

</div>

XD. It doesn’t take many objects.

---

<div class="post-metadata">

**Author:** ![B00T987](https://community.flowlab.io/user_avatar/community.flowlab.io/b00t987/32/70321_2.png) [@B00T987](https://community.flowlab.io/u/B00T987)\
**Post date:** [April 1, 2024, 5:05pm UTC](https://community.flowlab.io/t/secret-invisible-area-example-easter-eggs/42648/5 "2024-04-01T17:05:55Z")

</div>

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](https://flowlab.io/game/play/2497449)

---

<div class="post-metadata">

**Author:** ![Samuel\_Tome](https://community.flowlab.io/user_avatar/community.flowlab.io/samuel_tome/32/71675_2.png) [@Samuel\_Tome](https://community.flowlab.io/u/Samuel_Tome)\
**Post date:** [April 1, 2024, 5:41pm UTC](https://community.flowlab.io/t/secret-invisible-area-example-easter-eggs/42648/6 "2024-04-01T17:41:32Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Samuel\_Tome](https://community.flowlab.io/user_avatar/community.flowlab.io/samuel_tome/32/71675_2.png) [@Samuel\_Tome](https://community.flowlab.io/u/Samuel_Tome)\
**Post date:** [April 1, 2024, 5:44pm UTC](https://community.flowlab.io/t/secret-invisible-area-example-easter-eggs/42648/7 "2024-04-01T17:44:21Z")

</div>

Awesome! You go! 🔥 I can confirm that indie is cool indeed 🙂

---

<div class="post-metadata">

**Author:** ![CodeAlpaca](https://community.flowlab.io/user_avatar/community.flowlab.io/codealpaca/32/56715_2.png) [@CodeAlpaca](https://community.flowlab.io/u/CodeAlpaca)\
**Post date:** [April 1, 2024, 7:10pm UTC](https://community.flowlab.io/t/secret-invisible-area-example-easter-eggs/42648/8 "2024-04-01T19:10:56Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Kasamir](https://community.flowlab.io/user_avatar/community.flowlab.io/kasamir/32/46922_2.png) [@Kasamir](https://community.flowlab.io/u/Kasamir)\
**Post date:** [April 2, 2024, 1:46am UTC](https://community.flowlab.io/t/secret-invisible-area-example-easter-eggs/42648/9 "2024-04-02T01:46:19Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![CodeAlpaca](https://community.flowlab.io/user_avatar/community.flowlab.io/codealpaca/32/56715_2.png) [@CodeAlpaca](https://community.flowlab.io/u/CodeAlpaca)\
**Post date:** [April 2, 2024, 2:58am UTC](https://community.flowlab.io/t/secret-invisible-area-example-easter-eggs/42648/10 "2024-04-02T02:58:26Z")

</div>

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)

---

<div class="post-metadata">

**Author:** ![Samuel\_Tome](https://community.flowlab.io/user_avatar/community.flowlab.io/samuel_tome/32/71675_2.png) [@Samuel\_Tome](https://community.flowlab.io/u/Samuel_Tome)\
**Post date:** [April 2, 2024, 8:49am UTC](https://community.flowlab.io/t/secret-invisible-area-example-easter-eggs/42648/11 "2024-04-02T08:49:47Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Samuel\_Tome](https://community.flowlab.io/user_avatar/community.flowlab.io/samuel_tome/32/71675_2.png) [@Samuel\_Tome](https://community.flowlab.io/u/Samuel_Tome)\
**Post date:** [April 2, 2024, 9:54am UTC](https://community.flowlab.io/t/secret-invisible-area-example-easter-eggs/42648/12 "2024-04-02T09:54:09Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![CodeAlpaca](https://community.flowlab.io/user_avatar/community.flowlab.io/codealpaca/32/56715_2.png) [@CodeAlpaca](https://community.flowlab.io/u/CodeAlpaca)\
**Post date:** [April 2, 2024, 9:59am UTC](https://community.flowlab.io/t/secret-invisible-area-example-easter-eggs/42648/13 "2024-04-02T09:59:48Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Samuel\_Tome](https://community.flowlab.io/user_avatar/community.flowlab.io/samuel_tome/32/71675_2.png) [@Samuel\_Tome](https://community.flowlab.io/u/Samuel_Tome)\
**Post date:** [April 2, 2024, 10:12am UTC](https://community.flowlab.io/t/secret-invisible-area-example-easter-eggs/42648/14 "2024-04-02T10:12:52Z")

</div>

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 👍🏽

---

<div class="post-metadata">

**Author:** ![JUSTPLAINOP](https://community.flowlab.io/user_avatar/community.flowlab.io/justplainop/32/62091_2.png) [@JUSTPLAINOP](https://community.flowlab.io/u/JUSTPLAINOP)\
**Post date:** [April 8, 2024, 6:08pm UTC](https://community.flowlab.io/t/secret-invisible-area-example-easter-eggs/42648/15 "2024-04-08T18:08:17Z")

</div>

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_Tome?

---

<div class="post-metadata">

**Author:** ![Samuel\_Tome](https://community.flowlab.io/user_avatar/community.flowlab.io/samuel_tome/32/71675_2.png) [@Samuel\_Tome](https://community.flowlab.io/u/Samuel_Tome)\
**Post date:** [April 9, 2024, 11:43am UTC](https://community.flowlab.io/t/secret-invisible-area-example-easter-eggs/42648/16 "2024-04-09T11:43:12Z")

</div>

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 👁 👁🔥

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

---

<div class="post-metadata">

**Author:** ![B00T987](https://community.flowlab.io/user_avatar/community.flowlab.io/b00t987/32/70321_2.png) [@B00T987](https://community.flowlab.io/u/B00T987)\
**Post date:** [April 9, 2024, 4:29pm UTC](https://community.flowlab.io/t/secret-invisible-area-example-easter-eggs/42648/17 "2024-04-09T16:29:52Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![JUSTPLAINOP](https://community.flowlab.io/user_avatar/community.flowlab.io/justplainop/32/62091_2.png) [@JUSTPLAINOP](https://community.flowlab.io/u/JUSTPLAINOP)\
**Post date:** [April 9, 2024, 5:05pm UTC](https://community.flowlab.io/t/secret-invisible-area-example-easter-eggs/42648/18 "2024-04-09T17:05:21Z")

</div>

![image](https://community.flowlab.io/uploads/default/original/3X/3/a/3a725dc382dd73c2160cfd7c0f64c6ca86e956cb.png)  
It looks so good!

---

<div class="post-metadata">

**Author:** ![Samuel\_Tome](https://community.flowlab.io/user_avatar/community.flowlab.io/samuel_tome/32/71675_2.png) [@Samuel\_Tome](https://community.flowlab.io/u/Samuel_Tome)\
**Post date:** [April 9, 2024, 5:14pm UTC](https://community.flowlab.io/t/secret-invisible-area-example-easter-eggs/42648/19 "2024-04-09T17:14:42Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![B00T987](https://community.flowlab.io/user_avatar/community.flowlab.io/b00t987/32/70321_2.png) [@B00T987](https://community.flowlab.io/u/B00T987)\
**Post date:** [April 9, 2024, 7:42pm UTC](https://community.flowlab.io/t/secret-invisible-area-example-easter-eggs/42648/20 "2024-04-09T19:42:13Z")

</div>

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