Ladders Unity and #30daydev

Categories: #30daydev, Game

Making a lot of small games, and only thinking about making it work and not on optimization and correct structures, have made a lot of old problems vanish. 🙂 For instance, months back I spend days on a small problem with a character and detecting when he was on a ladder, it ended with me shelving the project.. It should have been soooo simple, but my character was made up of 3 colliders, and they where animated, so using OnTriggerEnter2d didn’t work as I got an “enter” on one collider and another “enter” for the next and so on, and the same when one collider would “exit” the ladder collider. But now doing other small projects and optimization isn’t in focus, I wanted to revisit it, and as clear as it should have been back months ago, the solution was clear. 🙂 Just make a child GameObject add a small collider on a layer that only interacts with ladders and a small script detection OnTriggerEnter/Exit2d and send the information to the parent script. I haven’t tested it yet, but can’t see why it shouldn’t work 🙂

The #30daydev have already given me so much, and I’m only halfway there. 🙂 I’ll keep learning..

Now, go make games! 😉

– Henning


    Leave a Reply

    Your email address will not be published. Required fields are marked *