Ambiera ForumDiscussions, Help and Support. |
|
|
|||||
|
Hi. I would like move a scene node left and right on the X axis but I have noticed the movement is not smooth. What I mean, when I press a key down, the object move once then stop for a moment then continue the movement but the movement is a bit lumpy like the FPS would be low or the scene would be not rendered every frame. I tried using the built-in actions to change position of the node, I also tried the custom action from the tutorial to move a node: https://www.ambiera.com/coppercu... And I also tried using JavaScript: https://www.ambiera.com/forum.ph... Whatever I try I get the same results on both Windows and WebGL. I notice the same problem actually in the game Painted Legend which is made with CopperCube. And I also notice the same in the Terrain Demo, it feels like not every frame is rendered when I'm moving around. Is there anything else I can try? Note that, I can not use Physics to move anything because my target platform is WebGL and it got no physics to move anything I believe but I wish I would be wrong. Any help would be appreciated. Thank you. |
||||
|
You should set variables, and move your character based on which variables are active. Example: If Left button is pressed, the variable "MoveLeft" equals 1. If Left button is released, the variable "MoveLeft" equals 0. If "MoveLeft" equals 1, the character node will move Left. If you do that, the movement will be very smooth. Try this CCB file that I gave to another person with the same problem: https://drive.google.com/file/d/... |
||||
|
Thanks a lot for the example. It is probably something on my part because it is not smooth on my end. More noticeable if I slow it down to move only 1 pixel/frame. On my end it seems like there is a break between each draw call and the screen get updated only every 10 frames or something. Not smooth at all. It might be a compatibility problem with my hardware or my graphics driver. Thanks anyway, I'm appreciate your help. |
||||
|
@wild-master I have tried on a different PC with a different GPU and SSD and I get the same results. Is it really, totally smooth on your side and am I the only one who is experiencing that small jumps/frame drops? Not only in your example but also in the Terrain demo and the game Painted Legend. Could anyone tell me how can I display an FPS counter to see if the FPS actually drop on my side or is it glitches with drawing the screen only? Thanks. |
||||
|
I've found the checkbox to display FPS. If that is correct, the FPS does not drop. |
||||
|
In the publishing settings for WebGL I checked the box to wait for all textures to be loaded, for Windows I switched to OpenGL and also checked the box for vertical sync and it seems to solved the problem :) |
||||
|
you can use acceleration and deacceleration for the movement of your object scenenode... It may help you with the smooth movement.. |
||||
|
Thanks. |
|