How to code a "punching wall" obby part

Last updated: February 18, 2025

  1. Start with your wall and add whatever stepping blocks you want. In this example, they are round ramps made from wedges

  2. Place a small normal block in the wall, having alittle but poke out the front. Make this neon to let the player know it will be a kill brick.

  3. Selecting our punching kill brick, open up the code builder. From Event add an at start block, followed by a do forever block Control.

  4. Inside, put a wait -- seconds block from Control. Set the seconds to however long you want it to delay. follow it by a tween position in plot block from Motion. Change the seconds to 1 for a fast punch, and enter "-4" into the X input

This depends on which direction you're facing. X= front and back, Z=Left and right. if it doesn't work, simply change the Z input instead

  1. Repeat step 4, however change the seconds to how long you want it to stay out and change the negative input to a positive input to bring the block back.

  2. To the side, turn it into a kill brick by placing a when touched by a player block from Events followed by a change player health block from Player

Your code should look like this!

  1. Don't forget to colour your obby part and you're ready to play!

Was this article helpful?

Thanks for your feedback!