Set properties to a group of objects

Hi everyone, I’m very new to Unity so go easy on me :).
I am trying to create a board game where I have units and my opponent has some of his own.
Now I want to apply gravity and a collision detection to all the units but I don’t want to do it manually, I orgenized then in a group and I want to apply a script to that group that will enable gravity and collision detection. How can I do that? I’m a programmer so don’t be afraid to show me some codes or if you guys can help me find a source where I can learn Unity from that would be awsome.

@Ridicolous

You can learn basic scripting in Unity C# from Unity Learn Premium (completely free)

and everything (scripting and using the Unity Engine) from Unity documentation:

If you want to add gravity and collision detection fast, just hold Ctrl and select all game objects you want to apply it, then add Rigidbody and a corresponding collider.

You should look into Prefabs. https://docs.unity3d.com/Manual/Prefabs.htmlDocumentation/Manual/Prefabs.html#:~:text=You%20can%20create%20a%20prefab,gameobject%20with%20the%20new%20one.

Basically, once you make a prefab, it is easy to make copies of it.
So let’s say you figure out how to make one board game unit for your game,you write some code,
get the colliders set up,everything is perfect. You can then create a prefab of it. Then if you want another copy, it’s super easy to make another copy of the prefab.

Then, say, later on, you decide you need to change something about the board game unit. Maybe it’s red and you want it to be blue.
You can change individual copies (make some red, some blue). You can also change the prefab itself- say, if all of your copies are red, and you want them all to be blue, you can just change the prefab.
This is really nice because you don’t have to change each copy individually!

Check out this tutorial video on prefabs:


Hope this helps!