- Home /
Physic based golf game - ball bouncing off the connection of colliders on flat surface
Hi, I'm making a golf game, which has a major flaw. I am using modular models for the golf course. As the image shows, when ball comes into contact with other collider, it always bounces off. What are solutions or work-arounds to solve the issue?
I tried both box and mesh colliders, none worked out.
Are the colliders exactly matched up perfectly and dont have any gaps in between?
Unfortunately there isn't really a way around this, you have to make sure the whole path is one smooth collider.
Answer by Bunny83 · Sep 16, 2017 at 09:19 AM
This is a common problem and there isn't really a way to fix it the way you have it currently. The best solution is to use a single MeshCollider for the whole course.
If you build your courses with modular pieces you would need to merge the seperate MeshColliders into a single one when the level initializes. We did something similar for a racing game that was a bit like TrackMania. If the placement of the modular pices isn't perfect you may want to do an additional procedural "vertex snapping" while merging two mesh colliders. That means you just search for two vertices that are very close together but not identical and set both to the same position (for example to the mean of the two positions: (p0 + p1) / 2)
Answer by Ambroisecorentin_sned · Nov 13, 2017 at 10:49 AM
HI, i have the same problem , but i can't remerge the modular because i want the player be able to build his own level.
Your answer
Follow this Question
Related Questions
Best collision detection method? 2 Answers
Detect if a non-trigger collider is inside another collider 1 Answer
OnCollisionEnter isnt called when player lands on object 1 Answer
Excluding some physics collisions 3 Answers
No Collision 3 Answers