Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Collision layer bit over 32 or negative can be set in 3.x #49934

Closed
RikKargones opened this issue Jun 26, 2021 · 3 comments
Closed

Collision layer bit over 32 or negative can be set in 3.x #49934

RikKargones opened this issue Jun 26, 2021 · 3 comments

Comments

@RikKargones
Copy link

RikKargones commented Jun 26, 2021

Godot version

3.3.2 stable

System information

Windows 7

Issue description

Issue in topic. I think engine should trow an error, if it can't support what layer bit anyway. It might be important for some users, for example, what can choose exact layer bit by formula or something.

And just little request for addition: please, make shown in editor all supported 32 collision layer bits. It's was an unpleasant surprise for me and give addition unnecessary work to rewriting code. At least just make a short-term solution, if you discuss about UI usability in editor, it will be better than nothing.

Steps to reproduce

  1. Add any PhysicsBody2D or Area2D to scene, add script to them.
  2. Set by set_collision_layer_bit any unsupported bit (-1, 37, 96 e.t.c) to true in code.
  3. Ready to check and show! Code for checking may looks like what:
for i in 70:
    if get_collision_layer_bit(i-10): print(i-10)

Minimal reproduction project

No response

@greatmomo
Copy link
Contributor

Interestingly enough, the values seem to be added twice when they exceed the limits.
For example, set_collision_layer_bit(36, true) sets 36, but also 4 (36-32).

@Calinou
Copy link
Member

Calinou commented Jun 27, 2021

This was fixed in the master branch by #34823, but was never cherry-picked or remade for the 3.x branch.

@Calinou Calinou changed the title Collision layer bit over 32 or negative can be set Collision layer bit over 32 or negative can be set in 3.x Jun 27, 2021
@akien-mga akien-mga added this to the 3.4 milestone Jun 28, 2021
@akien-mga
Copy link
Member

Fixed by #34823 (4.0) and #49955 (3.4).

@akien-mga akien-mga modified the milestones: 3.4, 4.0 Jun 28, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants