Hello all, I have been testing godot a bit for the last 2 days. So far I'm liking it.
I have been trying to create a small pong-like game where I have a circle made of off many rectangles.
Every rectangle has a rectangle collision shape, and they are rotated to create a circle.
The ball is created with a circleshape.
The problem Im having is that the ball only "bounces" correctly when colliding with either the top or the bottom rectangle, when it hits any other it kind of "throws" the ball out of the circle
Kind of hard to explain so here's a gif showing what I mean:
Here's the code for the ball:
const speed = 50
var direction = Vector2(0, -1)
var paddles = 
var velocity = direction * speed
var motion = velocity * delta
motion = move(motion)
var colliding_paddle = get_collider()
var paddle_color = colliding_paddle.get_color()
var normal = get_collision_normal()
motion = normal.slide(motion)
#new direction, for now take the normal
direction = normal
Really lost here, not sure how to approach fixing this ... would appreciate any help to make it work :)