Godot Version 4.3
Question
Hello, I am considering moving my 2D Metroidvania from Unity to Godot and I already found some useful plugins like MetSys and Phantom Camera but I wanted to know something beforehand.
Can I swap from a human player character to a fish player character while I am making contact with water. So when I collide with water I transform into a fish and when I get out of water I become a human, two completely different playable characters. Is that possible here?
I think you are talking about the particular observer feature you can easily have on Unity that determines if you are inside a specific collision trigger. It’s honestly a pain in Godot since there is no “while inside collision” signal. It can be replicated but is much more trickier, especially when dealing with multiple colliders.
You pretty much need a counter system to keep track of each collision entered or exited. And good luck dealing with colliders that spawned already overlapping with the object as there would be no entered signal. Nowhere near as out-of-the-box as it is in Unity.
2 Likes
Ok I see, so there is no while colliding with water object in Godot. And the turnaround seems hard. I hope they implement it. Thank you, your answer saved me a lot of time
Can’t Area entered and exited signals simply be used for this?
If you enter an Area and the area_entered signal is emitted, it is logical to assume that the object is still inside the Area until then area_exited signal is emitted.
2 Likes
It is definitely possible. It might not be structured the same way you do it in Unity, but it is possible and shouldn’t be too complex.
2 Likes
Oh thank you so much! I really like the look and feel of Godot, so I will look into this now
If you are dealing with a single collider is no problem. If you have multiple of them that overlap it can become a problem.
For example: Think of a single water object that is a square on screen. You either enter the square once or exit. However, now think of multiple squares of water that overlap for some reason (maybe different size squares to compensate for an uneven terrain). As you enter, the enter signal runs, but because they overlap at some point, when you get to that point you are going to enter the second square first, triggering the enter signal again which should do nothing. Then you exit the first square of water while being inside the second at the same time. If you don’t keep count that you entered a new square, the exit signal is going to run while you are still inside the second square of water.
Another even more difficult problem would be a water square that appears and disappears visually and physically, deactivating the collisions as it disappears and activating them when appearing. What if it disappears before you enter the area and appears when you are in the exact middle of everything. There is not going to be an enter code when it appears or a exit code when it disappears. Now what?
If these are the issues can be easily solved though, unless I don’t understand them. Maybe it’s easier and is a plug and play system in Unity, but I am certain what OP wants is possible in Godot.
1 Like
Oh yeah, they can be solved. I think pretty much everything can be solved in Godot in some way or another. But for those that come from Unity is something to watch out for, as it can become a monumental headache in Godot. Given the case.
1 Like
Thanks for all the encouragement. I am making a Metroid-vania game, emphasis on Metroid, so I want to have two characters, so the each one can interact with stuff that the other can’t. One is a fish and the other one is a humanoid evolved death worm, will be like symbiosis, a familiar creature. So when you collide with water it transforms into a fish and when it goes out of it it tranforms back in a metroidvania setting.
I see that Area 2D is similar to Unity Collision2D so it works. Now I’m upgrading my main char and slowly migrating to Godot