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

Enemies should use CC2D as well? #104

Open
aidinzolghadr opened this issue Dec 11, 2019 · 1 comment
Open

Enemies should use CC2D as well? #104

aidinzolghadr opened this issue Dec 11, 2019 · 1 comment

Comments

@aidinzolghadr
Copy link

Hi,

Since all objects change the same Physics2D matrix for collisions upon entering Play mode, if one character, like player, set some layers for trigger under CC2D's Trigger Mask, they will be overridden by any other character like enemies having different config for the same thing.

For example currently Player has Layers 1, 2 and 3 set in it's Trigger Mask and Enemy has Layer 4 and when I launch the game and see Physics 2D matrix, I can see Player collision matrix overridden by Enemy's. Hope I've made myself clear. From

Is CC2D is designed with only main character using it in mind or am I missing something here? Any workarounds?

Thanks.

@Alriightyman
Copy link

I've used it for a few enemies. And you are right about the Physics2D matrix being changed.
You can edit the CC2D in the awake method and comment out or remove the for loop there. However, you will need to manually adjust your Physics2D Matrix.

Setting the layers in the CC2D is just a helpful way of editing the Physics2D Matrix.
Hope this helps in some way.

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

No branches or pull requests

2 participants