krum110487 Posted September 18, 2016 Share Posted September 18, 2016 (edited) Hello, I am fairly new to babylonjs, but I found this weird thing where on each layer sprites will run at different speeds. to see this in action simply change the layermask from LAYER_FG to LAYER_BG. var spriteManagerPlayer = new BABYLON.SpriteManager("playerManager", "textures/player.png", 2, 64, scene); spriteManagerPlayer.layerMask = LAYER_FG; http://www.babylonjs-playground.com/#CSAVV#1 from playing around with it, it seems the foreground is running 3 times as fast, you can see it demonstrated in this code:http://www.babylonjs-playground.com/#CSAVV#2 I also noticed that when I leave the tab and come back in chrome they start to get out of sync, but if you stay on the page, they will stay in sync. is this expected? I am a bit confused as to why this may be. Right now I am experimenting with 2d and 3d plains on different layers, I am also going to be experimenting with renderGroups. So forgive the messy code. Thanks, Edited September 18, 2016 by krum110487 Found new information Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted September 19, 2016 Share Posted September 19, 2016 Hello I guess the problem comes from the runRenderLoop. The playground has its own renderloop already defined. This sample seems then to work: http://www.babylonjs-playground.com/#CSAVV#8 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.