+1 vote

I have a ball instance that is a RigidBody2D and I want it to 'activate' a button. This button is a KinematicBody2D. I don't think that the button should be a KinematicBody2D, but what do I know.

Any help would be greatly appreciated!

in Engine by (15 points)

Can the button move? What does it do after it's been activated?

1 Answer

+1 vote

RigidBody2D can report collisions (contact monitor need to be enabled and set to more than zero) and you can get them via signal (body_enter) or checking on fixed process/custom integrator (get_colliding_bodies).

Then just just do something like getting the group of the object is touching (you can check the angle and other things to detect a correct trigger collision), if you identify it as a "button", tell that button to do something.

by (7,838 points)
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 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 webmaster@godotengine.org with your username.