Moving Platforms

Blitz3D Forums/Blitz3D Programming/Moving Platforms

jfk EO-11110:
I will try to explain:
I do nothing when character is on the platform and the platform goes down to y-axis. Blitz3D works fine in this stage because collision is working as I excepted.

The problem arrives when the platform goes up to y-axis. In this case as I said before because of character's gravity, Blitz3D does not work well and the character falls down through the platform mesh.

The only solution is to stop the character's gravity and set its y-velocity equal to platform y-velocity. But in this case there is a new problem: I can't get a collision from Blitz3D (because y-velocities are equal) and I don't know "when" the player has gone away from platform mesh in order to set again the gravity on.

The solution is: Place a dummy mesh (with entityalpha=0) but make it active to collisions with the platform. Put this dummy mesh under the platform, give it a negative velocity, and move it on x-z plane as the character. Know I have collision information from this dummy mesh and it is the same information I need for my character.

I hope to help you