![]() The tallest object which spans the vertical of the screen is 60 units tall. The smallest object in the scene is the ball with a scale of 2 built in unity as a sphere primitive. ![]() The reason the timescale is so high is I scaled everything up quite a bit to get away from problems with physX and small objects. ![]() This is all done with pretty aggressive situations, the ball is moving quite fast, big drops, the timescale is at 2.75. 01 I get an error about 1 out of 4 drops. 005 I get an occasional error, perhaps 1 out of 20 ball drops. The only variable I've changed that has had any effect on the error rate is the timestep. I'm not sure now how this is going to work on slower hardware. Almost everything else will be static, possibly I will add some other moving objects, not sure. Also the only rigidbody in the game is the ball, I don't think thats going to change. I haven't optimized anything in my game yet so it will get considerably better. I exported a build to my daughters 5 year old laptop with an integrated GPU, it ran like hell, but it ran (sort of) at timestep. During all this testing I had the fixed timestep at. I also tried continuous dynamic on the ball with a mesh collider on the rectangle objects, in the documentation it stated continuous dynamic will only work against a mesh collider not a box collider or else it defaults to discreet, so I switched that to no effect. 001 for penalty testing, I've left it at. It hopefully is reassuring to you to know this is actually quite a common physics problem that crops up again and again over the years (physics problems between the edges of two blocks). There are many solutions but it starts with realising that this is happening because it sinks in tile one enough before it hits tile 2. This way, when you DO collide, you already have the ray and normal, so you can simply set its new velocity how it should be on collision exit to override. To do this is simple enough, you raycast along the velocity vector of the ball, so there is a ray going in the direction you are travelling. Try like handling the collision yourself. use a raycast just ahead of the ball and prevent it overlapping to begin withĥ. Try continueous dynamic collision for the ball and continueous for the surface (try this next)Ĥ. Try setting project settings -> physics -> min penalty to 0 or 0.001 etc (try this first)ģ. The default is 50fps, but a higher update rate will lead to less penetration.Ģ. There are several ways to solve this, all of them are expensive.ġ. The reason this occurs is because the object penetrates block 1, and bounces off the side or corner of block two. I've read several posts about this but haven't found a solution that will work here. I've messed with every setting I can think of with no difference in results. The static game objects I've tried box collider and mesh collider. The ball is a Rigidbody with a Sphere Collider. I also need all sides of the rectangles to correctly take hits. The game objects are going to be rotated, sometimes moving, in unlimited possible configurations. I've had this problem before and solved it by taking the colliders off the game objects and just throwing down a single plane over the entire length of the game objects and adding a collider to it, but with this game being dynamic, writing a script to do this at runtime would be a nightmare. The ball bounces off the object 2 corner as if object 1 does not exist. In the picture there are 3 separate objects, the red arrow is where the ball is headed, the dark green arrow is where it should go, the blue arrow is where it goes on the occasional bad bounce. I have a game board with dynamic objects that the user adds and positions.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |