-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I'm setting the same force with applyForce but the path rarely it's equal. #1167
Comments
Can you try setting runner.isFixed to |
Hi @liabru, i tried but i didn't success. So i noticed that when i launch the ball with a timeout, e.g 500ms, the ball always do the same path. So i imagine that what you suggested make sense but i couldn't implement. Follow some parts of my code. Here i create the engine and render.
and at the final i run
Am i doing something wrong? I'll try read again the doc. |
I'm facing the same issue :( |
Do you have a link to an example I could try? Are you launching the ball exactly the same every time? |
Hi @liabru, sorry for delay. I had a lot tasks last weeks. Follow my link to you see. I'm launching the ball with the same force, from the same position and setup the runner with isFixed: true, but many times i got different simulations. Do you know what i could do wrong. I need to get the same simulation independent the time that i launch. |
This is due to changing function launchPinball() {
// var timescale = ((1000 / runner.fps) / 16).toFixed(2);
// engine.timing.timeScale = timescale;
updateScore(0);
Matter.Body.setPosition(pinball, { x: 465, y: 765 });
Matter.Body.setVelocity(pinball, { x: 0, y: -35 });
Matter.Body.setAngularVelocity(pinball, 0);
} I've made a note to improve the docs around this. |
@liabru when i removed this part of code and i faced two issues. The first is that i don't have the same simulation e.g in 10 times. The second is when you use different frame rate you have different simulation between each frame rate. So in 60hz you will have simulations similar and close, still not equal. However if you change to another monitor, 120hz, you'll have another power, gravity another simulation, for my game it is vital. I updated the code to you test. |
Hi everyone, i'm trying to launch a ball to top, in a plinko game, but i could't launch the ball to the same height even setting the same force with applyForce. Sometimes the ball up 600px, other 800px and rarely do the same path when drop by the plinko.
When i create the ball at the top of the plinko the ball ALWAYS do the same path, always. So i'd like to reproduce this behavior but launching the ball. Anyone has an idea how can i do this?
If you've some doubt let me know to clarify.
The text was updated successfully, but these errors were encountered: