irok84 Posted January 15, 2015 Share Posted January 15, 2015 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 More sharing options...
irok84 Posted January 16, 2015 Author Share Posted January 16, 2015 There is second collision issue in this example. On start, character stays on green tile (floor), but look at 0:18 - he is behind the tile. Anyone knows how to fix these collision/fall problems? Link to comment Share on other sites More sharing options...
irok84 Posted January 21, 2015 Author Share Posted January 21, 2015 Here is jsfiddle: http://jsfiddle.net/xc5mpab4/As You see, player is on "elevator", but after few seconds he falls down. You can move the player, so try to jump onto elevator again, player will fall again. Link to comment Share on other sites More sharing options...
valueerror Posted January 21, 2015 Share Posted January 21, 2015 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 More sharing options...
valueerror Posted January 21, 2015 Share Posted January 21, 2015 http://test.xapient.net/phaser/ALL/moving-jumpthrough-platform-final.html here is a working example with p2 physics but the movement of the platforms should be the same in arcade Link to comment Share on other sites More sharing options...
irok84 Posted January 21, 2015 Author Share Posted January 21, 2015 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 calculations2. 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 More sharing options...
Massemassimo Posted January 22, 2015 Share Posted January 22, 2015 Yes, my floors are all static and the player is moving only through changes of velocity. Still the same problem occurs. Link to comment Share on other sites More sharing options...
irok84 Posted January 26, 2015 Author Share Posted January 26, 2015 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 More sharing options...
Recommended Posts