Lesson 7: 3D Game Development - Models, Materials, and 3D Physics

You have used 2D sprites and 2D physics. Many Unity projects are 3D: characters, environments, and objects are 3D models with materials and 3D physics. In this lesson you will import 3D models, assign materials and shaders, work with lighting, and use Rigidbody and Collider in 3D so your game looks and plays like a full 3D experience.

By the end of this lesson you will:

  • Import 3D models (FBX, OBJ, or native) and configure import settings (scale, rig, animations).
  • Create and assign Materials and understand Shader basics (Built-in, URP, HDRP).
  • Place lights (Directional, Point, Spot) and adjust ambient and shadows.
  • Use Rigidbody and Collider in 3D for movement and collision (recap and extension of Lesson 5).
  • Know how 3D and 2D content can coexist and when to keep a project focused on one.

1. Importing 3D Models

Supported formats: FBX, OBJ, and native formats from DCC tools (e.g. Blender, Maya). FBX is common for animated characters and rigged meshes; OBJ for static props.

Import settings (Model tab):

  • Scale Factor – Match your DCC and game scale (e.g. 1, 0.01 if your app uses centimeters).
  • Mesh Compression – Off for development; Low/Medium/High to reduce build size when needed.
  • Read/Write Enabled – Enable only if you need to access mesh data from script at runtime (e.g. procedural mesh); otherwise leave off for performance.
  • Generate Colliders – Optional: Unity can add a MeshCollider from the mesh. Use for static environment; for moving objects prefer primitive or simplified colliders.
  • Rig – For skinned characters: set Animation Type (Humanoid, Generic, None) and Avatar if Humanoid. Configure Skin Weights and Optimize Game Object as needed.
  • Animations – If the FBX contains clips, they appear in the Animations tab. You can split or use them in an Animator Controller.

Pro tip: Keep LODs and collision meshes in mind. Complex meshes can be heavy; use LOD Group and simple Collider shapes (Box, Capsule) for moving objects instead of MeshCollider when possible.

2. Materials and Shaders

Materials define how a surface looks: color, metallic, smoothness, normal map, etc. Each material uses a Shader.

  • Create a Material: Right-click in Project > Create > Material. Assign it to a Mesh Renderer (or Skinned Mesh Renderer) via the Materials list.
  • Shader: Built-in has Standard (and Legacy); URP has Lit, Unlit, Simple Lit; HDRP has its own set. Use the shader that matches your render pipeline (Edit > Project Settings > Graphics).
  • Properties: Albedo/Base Map (color), Metallic/Smoothness (or separate maps), Normal Map, Emission. Adjust in the Inspector; for runtime changes use MaterialPropertyBlock or new Material instances to avoid shared material issues.

Textures: Import images (PNG, TGA, etc.), set Texture Type (Default, Normal map). Drag onto the material slots or assign via script. Tiling and Offset control UV repetition.

Pro tip: Use URP or HDRP for new projects; Built-in is legacy. If you see pink/magenta materials, the shader is not compatible with your pipeline – assign a pipeline-compatible shader (e.g. URP Lit).

3. Lighting in 3D

  • Directional Light – Sun-like; one often suffices for outdoor or general fill. Controls rotation (direction) and intensity.
  • Point Light – Omnidirectional; good for lamps, pickups. Set Range and Intensity.
  • Spot Light – Cone; good for flashlights, stage lights. Set Range, Spot Angle, Intensity.
  • Ambient – Window > Rendering > Lighting > Environment > Ambient (and Skybox). Affects unlit areas.
  • Shadows – Per light: Shadow Type (Hard/Soft) and Strength. In URP/HDRP, shadow distance and cascade are in the pipeline asset or quality settings.

Pro tip: For performance, limit real-time lights and shadows; use Baked or Mixed lighting for static environment and real-time only where needed (e.g. character and one key light).

4. 3D Physics – Rigidbody and Collider (Recap and Extensions)

You used Rigidbody and Collider in Lesson 5. In 3D:

  • Rigidbody – Mass, Use Gravity, Drag, Angular Drag. Is Kinematic for moving platforms (you set position/rotation in code).
  • Collider – Box, Sphere, Capsule, Mesh (use sparingly for static geometry). At least one of two colliding objects must have a Rigidbody for a response.
  • Physics Material – Friction and bounciness; assign to the Collider’s Material slot.
  • Layers – Use Edit > Project Settings > Physics (Layer Collision Matrix) so only the right layers collide (e.g. projectiles vs environment, not projectiles vs projectiles).

Moving 3D objects: Prefer Rigidbody.AddForce or Rigidbody.velocity in FixedUpdate for physics-driven movement. For kinematic objects (e.g. elevator), set Is Kinematic and move the Transform or use Rigidbody.MovePosition so the engine can interpolate and respect collisions.

5. 3D vs 2D in the Same Project

You can mix 2D and 3D in one project:

  • Rendering: Use a Camera with Projection: Perspective for 3D and Orthographic for 2D; or use different cameras and layers.
  • Physics: Do not put Rigidbody2D and Rigidbody on the same GameObject. Use Rigidbody and Collider for 3D objects and Rigidbody2D and Collider2D for 2D; they do not interact.
  • Sorting: 3D uses distance and render queue; 2D uses Sorting Layer and Order in Layer. Keep 2D and 3D content on separate layers/cameras if you combine them.

For a focused game, choose either 2D or 3D as the main pipeline and add the other only where it clearly helps (e.g. 3D characters in a 2D-style level).

6. Common Issues and Fixes

Model is huge or tiny – Adjust Scale Factor in the Model import settings or the Transform scale of the instance. Keep scale consistent (e.g. 1 unit = 1 meter).

Material is pink – Shader not found or wrong pipeline. Assign a URP Lit (or your pipeline’s equivalent) shader to the material.

No shadows – Enable Cast Shadows and Receive Shadows on the light and renderer; check Quality and Pipeline settings for shadow distance and resolution.

Object falls through the floor – Ensure the floor has a Collider, at least one object has a Rigidbody, and the Layer Collision Matrix allows the two layers to collide.

Summary

You learned how to import 3D models (FBX/OBJ), set up Materials and Shaders for your pipeline, and place lights and shadows. You revisited Rigidbody and Collider in 3D and saw how 3D and 2D can coexist. In the next lesson you will add Audio and Visual Effects – sound, music, and particle systems – to make your game feel alive.