I don’t know if this is a bug with the physics engine in unreal or some issue with blueprints that I have setup but I have a ball set up where the main player can enable the balls physics with a button press so when you press the button the ball falls hits a ledge that you can move and falls into a hole. You need to line up the ledge perfectly but the problem is that each time you release the ball it falls in a ever so slightly different direction which means that sometimes it might hit the ledge and sometimes it might not. This is a major gameplay element and I need it to hit the ledge in the exact same spot every time. Does anyone know why this is happening and if there is a way to fix this?
The physics used in unreal is PhysX and it’s designed for game physics, not perfectly accurate physics so things are never going to be perfect unfortunately. If you want to make something be identical every single time then you should animate it yourself rather than using physics.
Yup physics is done in games to not have items behave always in exactly same way.
But if you need that ball to be physics, you can cheat a bit, there are constraints or you can add some force that pushes ball into correct path, etc
You should also test if that ball when shoot from same spot with same force lands in various spots or in same, i think that in your setup ball does not start exactly in same position and with same speed.
So test first if that difference in landing spot is from different starting conditions or not.
How would I test if the starting conditions are different? I’m using a spawner to spawn the ball so could that effect it somehow. Also is there any settings that I could change in the physics sub stepping that would give me more controlled results?
Animation would never work unfortunately as the entire game is based around using objects to guide a ball to its final destination. You’re essentially creating a Rube Goldberg machine in every level to get the ball where you want it to so the balls behavior has to be 100% the same every time otherwise the player will never be able to move the objects into the right position for the ball to ping off them and fall to its final goal.
With a performance hit you can use substepping. It should increase precision
Check out the documentation here:
The Physics engine that Unreal utilizes is non deterministic, which means it is not guaranteed to respond the same every time. There should be some ways to help make the system more stable though, substepping can help, as Resped has mentioned. It’s also possible that there are some simple things you could tweak with the level geometry to help, do you have a picture of the level?
As far as I know, games like Crazy Machine, which are Rube Goldberg machine like, do their own “physics”. It’s build more on strict rules than a physics simulation. Most of the objects are placed using discrete grid and forces, velocities, acceleration and etc are rounded to some specific numbers. Because even if you use ODE engine, which is suppose to be deterministic, you can get non deterministic behavior in complex simulation, simply from limits of numerical precision and fact that you can’t use only geometrical primitives for all collision shapes. Like if you build a pool game, there are situations where you have to use rules to decide on order of distributing forces between objects, these rules have to be enforced by game logic itself.