Horizontal player movement on ascending vertical platform causes player to move through the platform.
Opened this issue · 3 comments
The issue seems to lie in VerticalCollisions in the Controller2D script.
When the player inputs Horizontal movement while on an ascending platform, the VerticalCollisions function does not seem to add the expected velocity.y. I've been able to figure out that the first "if (hit) {}" of the function only evaluates to "true" some of the time while the player is on ascending platforms. Other than that I'm unsure of what exactly is causing the problem.
I haven't been through the videos in a bit so please forgive me if I'm wrong. I have found (at least for my small projects) that making the player a child of any moving platform upon collision and deparenting when breaking contact (ie a jump) solves a lot of problems in a very simple way. Hopefully this helps.
I had the same issue until I increased the Vertical Ray Count and Horizontal Ray Count on the PlatformController. 6 worked for me, though it may depend on how large your platform is.
Same for me. Problem is that with the size of the platform, the player object can fit between the upwards rays so no collision will be detected. A possible simple fix would be to store the player's width in a constant, then override the platform class implementation of CalculateRaySpacing to use that and the platform width to generate an appropriate amount of rays for each platform automatically.