Jump to content

Moving platform falling


irok84
 Share

Recommended Posts

Hi,

 

I showed my problem on the video:
https://www.youtube.com/watch?v=7beTqZVm5f4&feature=youtu.be

 

As You see, character is falling down trough platform, but not always, only sometimes. 

It looks like it depends on computer speed, if is faster, then falling occurs less. If is slower (for example: if screen capture is enabled), then falling occurs more.

 

Collision is checked just by:

game.physics.arcade.collide(player, elevator1);

game.physics.arcade.collide(player, elevator2);

 

What I observed: if I slow down the "elevators" then falling does not occur (but i need to fix it for every speed of elevator).

Link to comment
Share on other sites

oh you are moving the platform with a tween..  no wonder your player falls through..   i am surprised it takes so long for the player to fall through the platform to be honest.

 

 

tweening means changing the x or y coordinate directly..  its like bypassing the physicssystem..   first the platform is at y =100 next frame it is at y=120  so it kind of disappears and then shows up somewhere else and while you are beaming your platform to another y coordinate the player suddenly stands in thin air...

 

use velocity and a custom function that checks the position of the elevator and changes the direction of the velocity according to the check!

Link to comment
Share on other sites

I can implement platform moving as in Your example, but:

 

1. It is only linear move... ok, its not a problem, i can change move style using some calculations

2. Check my second comment in this topic - player falls not only trough moving platform, he falls from static tile (floor) too!

Link to comment
Share on other sites

oh you are moving the platform with a tween..  no wonder your player falls through..   i am surprised it takes so long for the player to fall through the platform to be honest.

 

 

tweening means changing the x or y coordinate directly..  its like bypassing the physicssystem..   first the platform is at y =100 next frame it is at y=120  so it kind of disappears and then shows up somewhere else and while you are beaming your platform to another y coordinate the player suddenly stands in thin air...

 

use velocity and a custom function that checks the position of the elevator and changes the direction of the velocity according to the check!

 

Thank You valueerror. I changed platform movement from tween to chenging velocity in update() and it solved my problem.

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...