UPDATE: I've edited this post with my solutions at the bottom. Thanks to MysteryGM. Also, check out this thread I made on Reddit asking the same question.
I am working on a 3D minigolf game and have created a level with some ground and a castle (using the Kenney texture packs here ). The main issues I’m faced with are:
- Hitting the ball with any considerable force causes collisions with walls to not occur;
- The ball physics are very strange (e.g. weird and unexpected rolling behaviour – more on this below)
The ball is created as a RigidBody, scaling left at (1, 1, 1), default mass and gravity.
Update: I have also tried by enabling Continuous Collision Detection (Continuous CD) and it does not fix either of these issues.
Here is a link to the entire project.
Issue 1: Collisions
The ball seems to not collide with objects if it is moving relatively quickly. See this gif here as an example:
You can recreate this issue yourself by holding in left click and move the mouse forward to increase power and shoot in the direction of the bar that grows out from the ball. Aim at the castle, and release left click. You’ll see the ball go flying through the castle, no collision/bouncing off the castle walls that you’d expect.
Issue 2: Weird ball behaviour
The ball movement is really odd and not natural in some circumstances. The most frequently occurring issue is the ball rolling for a long time in a fairly unpredictable way. Here is a gif I’ve captured of a low power shot towards one of the mounds, the ball moves up and down the mound in a fairly natural way, but then it just circles on the flag ground for a long time in a really unnatural way. I’m not sure what I’ve done in the project to result in this behaviour – the ground is totally flat from what I can tell. Here are a couple of examples of the ball movement i'm talking about:
This one shows the ball taking a fairly strange path after rolling back down the mound - it appears to wander aimlessly for a bit before coming to rest
This is my first time using Godot, so if you notice anywhere we could improve (antipatterns I’ve used, optimisations I could make), I’d love to know about them!
EDIT - SOLUTION:
With regards to issue 1, following /u/fuzavella's suggestion and increasing the physics FPS seemed to help reduce the collisions being missed at high speeds (keep in mind that there is a performance trade off). As of Godot v3.0.6, you can change the physics FPS in the editor by going:
Project > Project Settings > General > Physics > Common > Physics FPS
With regards to issue 2 (the continuous ball rolling and weird motion): The ball never stopped because (as far as I can tell), damping on the RigidBody for the ball was set to -1. I thought because friction was set to maximum that this would be enough, evidently not. Changing the damping of the RigidBody to some positive value seemed to make the friction take effect.