So I've been doing some experimentation with vertically moving platforms with the player sprite which has platform behavior and have been running into some problems. I did notice that there is a link to a vertical moving platform example in the[How to] section but I wanted to try to come up with my own solution before I looked at somebody elses, since I feel like this helps me get a better grasp of the Construct engine. I've narrowed it down to a very small capx project that contains some logging text fields to help keep track of events.
Vertical Movement Sample Capx
Basically my idea was:
Player spawns a small "foot detection" block (no special attributes) directly below himself, and the 'foot' is then pinned to the player. When player's foot overlaps with the vertical platform (later I'm going to add more precise detection to determine that the player is colliding on the top of the platform itself), the player is considered to be riding the platform, and the player's bottom Y is continually set to the platform's top Y value. This works without any problems, the problem is that when the platform is moving downward and in the mean-time *between* setting the player's Y, and going through another ??TICK?? (looping through another logic iteration), the engine sets the player to be in a "fall-state", so the player platform behavior will not respond to a jump action.
Do I need to control the platform's movement manually in the event sheet so that I can make it so that the player's Y is set to the Platform.Y *after* the platform has moved? I have a feeling that this might be part of it. It's just so nice to be able to use the Sine behavior to automatically control the vertically moving platform.
Thanks a lot everyone!
P.S. Don't worry about the DefaultInstances layer or the disabled gravity code.