This site is currently in read-only mode during migration to a new platform.
You cannot post questions, answers or comments, as they would be lost during the migration otherwise.
0 votes

Hi guys,

I've read many articles and the documentation in order to get the RigidBody2D to do what i want.

How is it possible to create a magnetic field like in a breakout game?

I get my ball stuck on the paddle and I can release it, but when my ball is stuck, i can't move my paddle OR my ball doesn't move with my paddle...

if body.getname() == "Player" and Input.isactionpressed("debugkey"):
emitsignal("clicked", self)
mode = RigidBody2D.MODE
held = true
if held:
globaltransform.origin = body.getnode("Anchor").getglobalposition()
if Input.isactionpressed("goball"):
held = false
mode = RigidBody2D.MODE

And my ball only get centered on my paddle with:

globaltransform.origin = body.getnode("Anchor").getglobalposition()

I want my ball stuck at the Position who it enters

Thanks a lot

in Engine by (20 points)

Please log in or register to answer this question.

Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read Frequently asked questions and How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to [email protected] with your username.