Problems with my moving platforms

Greetings everyone, I come humbly seeking advice regarding a problem I have encountered with my moving platforms. After following tutorials by the prolific and excellent @jamie_c I have implemented vertically moving platforms in my current project. I have a 'player' actor that can be moved left and right with the keyboard whilst having an accelerate behaviour that mimics gravity. The player can move left and right whilst falling down and lands on the platform just fine. The problem is that I need the character to move through the platform when approached from the side but it currently hits the side of the platform and stops moving in the X axis, even when it has fallen beyond the platform.

My attempt at a solution was to have a game level attribute that records the player's X cooordinates and to have a boolean attribute within the platform called 'collidable'. The platform has a rule that checks if the player's X coordinate is within it's own width, acounting for the width of the player and such. If so collidable is set to true, otherwise collidable is changed to false. Then within the platform another rule says if collidable is true collide with the player. I even have the platform displaying text above it to show the boolean value. After testing this the boolean switches from true to false as expected as you move the player in the X axis and the player collides with the platform when it is true. However once you step off the platform and collidable switches to false, you still can't move back through the platform consistently.

I have tried implementing some of the suggestions I have seen on the forums but I still can't seem to nail the execution. As such any help you could provide would be greatly appreciated. If this has already been covered somewhere I apologise and would be grateful for a pointer in the right direction. :)

Sign In or Register to comment.