|
|
|
|
Reply From: |
YeOldeDM |
Are you scaling collision shapes?
What’s the code for your ball? Specifically, the code which handles how it bounces?
What are these extra nodes on your bat? It looks like you have a kinematicbody as the child of another kinematicbody? That’s going to cause issues.
Showing off a broken build of your game isn’t going to provide us with much to help you with. A link to the project folder itself would be extremely helpful, not to mention a lot smaller of a download.
I suggest stripping out anything in your bat that doesn’t involve ball bouncing. Keep your testing environment clean and minimal, and it becomes much easier to solve problems like this.
Thanks for all your feedback. I’ll put in order here:
1 - I’m not scaling anything no.
2 - There are extra nodes int he bat for this reason: https://forum.godotengine.org/13408/play-my-beta-and-help-me-with-a-collission-bug They don’t interfere with each other as they’re on separate physics layers
3 - The access to use the build was simply so people could witness the behavior. That was the idea of the usefulness of the shared game in its current, bug visible state.
4 - Good idea with stripping out everything bit by bit. I’ll also get some code here in the next comment to show you what’s happening. There’s a lot going on but I’ll try and focus on the important stuff (no powerups etc etc)
Robster | 2017-08-02 02:31
For the ball.
When we hit the bat, this is the code that deals with bouncing:
ball._movement = normal.reflect(ball._movement) * ball.bounce*1.2
# add 20% as the gravity requires a bit more power to keep the ball playing well
When not hitting anthing (just flying through air) this is the code:
ball.move(ball._movement*ball.speedIncrement)
ball movement is setup in this function earlier on:
func launch(directional_force):
ball._movement = directional_force
In the update this is how it’s setup:
ball._movement.y += delta * ball._gravity
Actually, here is the complete ball.gd script, it’s just easier I think It’s too large to paste here (over 8000 characters) so pasting here in pastebin: extends KinematicBody2Donready var state = BatHugState.new(self) #this crea - Pastebin.com
Robster | 2017-08-02 02:42
I’ve stripped everything from the bat now. All there is, is a Kinematic, a sprite, a collisionShape. The bug still occurs. I’m totally stumped.
The code driving the bounce is ball.move(ball._movement*ball.speedIncrement)
but it only bugs out when it bounces off the collisionShape at horizontal or below horizontal angles. I can’t see how that line can make that an issue.
Robster | 2017-08-03 10:42