Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | Hussain |
so im making the ball reset if it touches the collision in my pong game but its not working i did exactly the same code as specified in the video here is the link for it
https://youtu.be/kr1BoEbuveI and my code for resetting the ball :
extends Node
func _on_Left_body_entered(body):
$Ball.position = Vector2(640,360)
func _on_Right_body_entered(body):
$Ball.position = Vector2(640,360)
this might not be what you are looking for, however you should put:
func onLeftbodyentered(body):
if body.is_in_group('ball')
$Ball.position = Vector2(640,360)
and add the ball to the ‘ball’ group (in image)
Snail0259 | 2021-07-09 06:17