- Home /
Unity 5 Sphere Rigidbody getting weird behaviour while moving around in a tiled mesh collider scene
Hi, so I've encountered this problem and I can't make my minigolf game without solving it. I have already tried many solutions but absolutely nothing works.
Not making the game based on modulable tiles isn't a valid solution, as this is planned to have a level editor for players to play with, too.
You can see a gif with the weird behaviour below on a tweet: https://twitter.com/devMidgard/status/779976521637298176
Check your code, it seams that ball direction has a parameter from mouse position and ball follow (probably adds a new force) this position even after you released the mouse. As far as i can see Sphere Rigidbody is not the case here. If you are using raycast position hit, try fixing your camera position and rotation and try again.
Hi, thanks for the help. I know my code and it's not applying any forces after you leave the mouse button. It's only the initial one. The Sphere Rigidbody is colliding with the edges of tiles and bouncing off them
Answer by seckincengiz · Sep 25, 2016 at 12:46 PM
I see. i recommend you to combine these meshes after a level design is finished. It is a good way to avoid physics related problems and also good for camera render speed. (example https://www.assetstore.unity3d.com/en/#!/content/8748) This way, after you created your level, you will have only one collider on the bottom.
There is another way for your current setup but i don't recommend you to use it. Speeding up the frequency of physics calculation on unity may solve your problem. If you haven't tried before, lower your Fixed Timestep under (Edit/Project Settings/Time) for example (0.001)