{"action":"created","issue":{"url":"https://api.github.com/repos/okamstudio/godot/issues/2587","labels_url":"https://api.github.com/repos/okamstudio/godot/issues/2587/labels{/name}","comments_url":"https://api.github.com/repos/okamstudio/godot/issues/2587/comments","events_url":"https://api.github.com/repos/okamstudio/godot/issues/2587/events","html_url":"https://github.com/okamstudio/godot/pull/2587","id":110729266,"number":2587,"title":"Fix Area2D type mask matching","user":{"login":"eska014","id":6996191,"avatar_url":"https://avatars.githubusercontent.com/u/6996191?v=3","gravatar_id":"","url":"https://api.github.com/users/eska014","html_url":"https://github.com/eska014","followers_url":"https://api.github.com/users/eska014/followers","following_url":"https://api.github.com/users/eska014/following{/other_user}","gists_url":"https://api.github.com/users/eska014/gists{/gist_id}","starred_url":"https://api.github.com/users/eska014/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eska014/subscriptions","organizations_url":"https://api.github.com/users/eska014/orgs","repos_url":"https://api.github.com/users/eska014/repos","events_url":"https://api.github.com/users/eska014/events{/privacy}","received_events_url":"https://api.github.com/users/eska014/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-10-09T20:18:27Z","updated_at":"2015-10-10T00:42:20Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/okamstudio/godot/pulls/2587","html_url":"https://github.com/okamstudio/godot/pull/2587","diff_url":"https://github.com/okamstudio/godot/pull/2587.diff","patch_url":"https://github.com/okamstudio/godot/pull/2587.patch"},"body":"Currently, `Area2DSW` has its non-existent `BodyMode` checked like a `Body2DSW`. This prevents, for example, performing raycasts only for `Area2D`s.\r\n\r\nThis change has the relevant function return as soon as all checks needed for `Area2DSW` are done.\r\n\r\nFixes #1906.\r\n\r\n(Curiously, setting the object type mask to `TYPE_MASK_AREA | TYPE_MASK_STATIC_BODY` works as a workaround to this bug — apparently calling `get_mode()` on a `Area2DSW` casted to a `Body2DSW` returns `TYPE_MASK_STATIC_BODY`? No idea what happens here…)"},"comment":{"url":"https://api.github.com/repos/okamstudio/godot/issues/comments/147017681","html_url":"https://github.com/okamstudio/godot/pull/2587#issuecomment-147017681","issue_url":"https://api.github.com/repos/okamstudio/godot/issues/2587","id":147017681,"user":{"login":"eska014","id":6996191,"avatar_url":"https://avatars.githubusercontent.com/u/6996191?v=3","gravatar_id":"","url":"https://api.github.com/users/eska014","html_url":"https://github.com/eska014","followers_url":"https://api.github.com/users/eska014/followers","following_url":"https://api.github.com/users/eska014/following{/other_user}","gists_url":"https://api.github.com/users/eska014/gists{/gist_id}","starred_url":"https://api.github.com/users/eska014/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eska014/subscriptions","organizations_url":"https://api.github.com/users/eska014/orgs","repos_url":"https://api.github.com/users/eska014/repos","events_url":"https://api.github.com/users/eska014/events{/privacy}","received_events_url":"https://api.github.com/users/eska014/received_events","type":"User","site_admin":false},"created_at":"2015-10-10T00:42:20Z","updated_at":"2015-10-10T00:42:20Z","body":"Turns out the 3D `Area` has the same issue.\r\n\r\nHowever, 3D `Area`s do not allow setting collision layers (yet?), so I changed the function to return even earlier for 3D, skipping collision layer checks completely for `Area`. I think this is the best option for now, since `Area` only colliding on collision layer 1 is somewhat unexpected.\r\nObviously if 3D `Area` gets collision layer selection like `Area2D`, it should be changed back again."}}