0 votes

Hi all, I have been working on a project and noticed that a body which is no where near the area2d is triggering the bodyentered and bodyexited signals when the scene loads.

The scale is one line of code here:

sightShape.scale = Vector2(sight_range, sight_range)

scaling for this is 6x in my test. The original radius is 32. The body is much farther than 192 pixels away (though a separate issue is the actual scale is much less than this for some reason when viewed with debug on).

After the scene loads, the area2d behaves normally. Though I can see potential cases where this could cause buggy behavior.

I assume that there is definitely an issue with scaling here: removal of the scaling line and this does not occur

Godot version 3.2.3
in Engine by (17 points)

1 Answer

0 votes
Best answer

Yes, it's a known bug that scaling collision shapes messes with the physics. You should change the extents of the shape instead of scaling them.

by (7,038 points)
selected by

Interesting, when I do it this way (using a circle):

    sightShape.shape.radius = int(sight_range * TILESIZE)

I get the same issue

That's strange. Does the body ever change position?

Ha! Why yes it does and I completely forgot about it. Thank you

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.