0 votes

I am trying to make a jump script where you cant jump again untill you collide with the ground or another object.
I've tried get_colliding_bodies(), tried using set_max_ocontects_reported(1) with it, I also tried func _on_Player_body_entered(body):
None of these have worked.
Is there anyway I can do this? Thanks in advance :)

in Engine by (15 points)

1 Answer

+5 votes
Best answer

To enable contact reporting on a rigid body (2D or 3D), you must do the following:

  1. Enable contact_monitor.
  2. Set contacts_reported to a value > 0.
  3. Connect the body_entered signal.

If it's still not working, then you have something else wrong in your setup.

by (21,309 points)
selected by

Thanks :)
The problem was I hadn't enabled contact_monitor.

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 webmaster@godotengine.org with your username.