About layers

less than 1 minute read

Introduction

I’m writing what Unity beginners learned as a memo

What is a layer?

Simply put, it’s like grouping game objects.

“shot” 2020-08-27 20.34.35.png

If you press the “Default” part of “Layer” on the upper right of this image, various players and Enemy will appear.

You can also create your own layer with Add Layer.

If you select “Player” by setting this, the game object will be treated as a Player group.

In this layer, you can set whether to judge collision between different groups.

「Edit」→「ProjectSettings」→「Physics」
Then go to a place like the image below.

Graphics.png

It is possible to set whether or not to judge collision between game objects where there are a lot of chuck boxes.

From the perspective, look at the chuck box where the layers on the vertical and horizontal axes overlap, and if it is checked, it will make a collision judgment, and if it is not checked, it will have to be done.

In this image, “Defauly” and “Enemy” are judged to collide.

Do not “Enemy Attack” and “Enemy”.

There seems to be something that can be applied other than collision detection, but that’s it for today.