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

Clarify Collision Bits Access #2050

Closed
putskan opened this issue Dec 30, 2020 · 0 comments · Fixed by godotengine/godot#44809
Closed

Clarify Collision Bits Access #2050

putskan opened this issue Dec 30, 2020 · 0 comments · Fixed by godotengine/godot#44809

Comments

@putskan
Copy link

putskan commented Dec 30, 2020

Describe the project you are working on

A multiplayer mini-game.

Describe the problem or limitation you are having in your project

The Godot editor describes the first collision layer bit, as "Layer 1"
image

However, I've notices that when accessing the bit from gdScript, the index starts from zero (e.g., get_collision_layer_bit(0))
That dissonance has confused me for a while, when implemented collisions using Area2D's collision layers & masks, and has caused bugs until I figured it out.

Describe the feature / enhancement and how it helps to overcome the problem or limitation

Simply Start from "Layer 0" in the editor (both in the Inspector, and in the Editor Settings).
That's relatively simple to implement, and would save other programmars' time and confusion.

Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams

Simply change the relevant labels :-)

If this enhancement will not be used often, can it be worked around with a few lines of script?

Yes, people would figure it out eventually, yet it has a low implementation cost, so I'd say it's worths it.

Is there a reason why this should be core and not an add-on in the asset library?

Because It's part of the main godot editor.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants