#i am trying to create pong to learn godot but im stuck on making the ball

11 messages · Page 1 of 1 (latest)

hollow lily
#

First things first: Take “var” off of lines 14 and 16 so they just say collider = …

#

You do not need var there because you have already defined the variable on line 6

#

Second thing: only check each raycast if the ball velocity is in the same direction

#

Like:
if velocity.x > 0 and $RayCast2D_right.is_colliding():
velocity.x = velocity.x * -1

loud solstice
#

nvm js got it bouncing

#

i needed to replace "velocity.x = velocity.x * -1" with "SPEED = velocity.x * -1"

#

new problem i now get this error when trying to launch the game

hollow lily
#

Both paddles will need it

loud solstice