Smos Bois
banner
smosbois.bsky.social
Smos Bois
@smosbois.bsky.social
Interaction Developer who wants to make games, toys and other fun stuff people can mess around with.

Wishlist Surf 'n Turf!
https://store.steampowered.com/app/3514850/Surf_n_Turf/

Simondebruijne.com
Now I wonder what the bad days look like 🫣
June 9, 2025 at 1:20 AM
We've made a ledgegrab! The ledgegrab has been the bane of my existence for the past couple weeks. Turns out a physics based game doesn't like it when you want to do something like this.

If you think the game looks cool, consider wishlisting it on Steam!

store.steampowered.com/app/3514850/...
Surf 'n Turf on Steam
Island-hopping, dish-making 3D platformer. In Surf 'n Turf you are a little lizard chef that gathers ingredients by hopping along islands with an expansive move set. Twirl and flip your way to the del...
store.steampowered.com
May 30, 2025 at 4:14 PM
From the start, I kept in mind the size of the player. Munch has always been made with a size of 1 units in Unity in mind.
The only thing I had to do was note down what the change of the position was at the end of the animation, copy these values to Unity, and teleport the rigidbody there
May 30, 2025 at 4:11 PM
During this animation, I lock the rigidbody in place where it started the ledgegrab. When the animation is finished, I teleport it atop of the ledge where the animation ended up.

A little sleight of hand, but the player never needs to know ;)
May 30, 2025 at 4:09 PM
It's a tough process, but absolutely worth it! You got this!
May 30, 2025 at 3:51 PM
The answer: I don't use the rigidbody for the ledgegrab!

While all other animations happen in place while Munch moves around. The animation for the ledgegrab moves the entirety of Munch.
May 30, 2025 at 3:50 PM
Now we face the biggest problem with the ledgegrab:

All the movement in the game is done by changing the velocity of a rigidbody, how do I do that for the ledgegrab? I can't just push it up and forward, it would look jarring and imprecise
May 30, 2025 at 3:34 PM
A ceiling would shoot a laser down, which would be a (0,-1,0) 3d vector.
A floor would shoot a laser up, a (0,1,0) vector.

That's the one we need, so we check if normal.y = 1

Now we only ledgegrab on flat platforms
May 30, 2025 at 3:10 PM
But hold on! if we hit a sloped surface we don't want to do a ledgegrab.
To check if what we hit is a flat surface, we can check the normal of what we hit.

A normal of a surface is the direction it's facing. Basically, if you shoot a laser from a hole in that surface, which direction would it go?
May 30, 2025 at 2:55 PM
To check if Munch has a ledge to grab onto, I send raycast that starts a little above and in front of Munch.
This raycast shoots down until it hits something, we can do a ledgegrab!
May 30, 2025 at 2:43 PM
The ledgegrab would penalize Munch by slowing their movement. If you want to keep your speed, perform the jump better 😈
May 30, 2025 at 2:31 PM
During testing, players would struggle with some platforms, often panicking when they missed it slightly.
Our solution: give a little leeway when reaching a platform.
May 30, 2025 at 2:20 PM
To start, I'm making a 3d platformer with a heavy focus on movement.
Introducing Munch, our main character, and the one who will be showing how a ledgegrab works!
May 30, 2025 at 2:17 PM
Very good point! I will try out different angles!
May 1, 2025 at 8:41 PM
I can see now that the video has been very heavily compressed, I promise the player is way more visible in-game. Usually the camera is even further from the player so there's more control when moving at high speed. Would you prefer a camera that's closer?
May 1, 2025 at 8:19 PM
Haha I struggled with this with pokemon gold. I played with my brother and we always reset after entering the first cave, since we didn't know what to do. They tell you how it works when entering, but we couldn't read it
April 25, 2025 at 12:48 PM