# Bake()

> Starts a synchronous bake job.

## Definition

* **Type:** Method
* **Namespace:** [UnityEditor](/engine/6000.7/script-reference/unityeditor.md)
* **Assembly:** UnityEditor.CoreModule

```csharp
public static bool Bake()
```

### Returns

| Type                                                          | Description                                                                                                                      |
| ------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------- |
| [bool](https://learn.microsoft.com/dotnet/api/system.boolean) | Returns true if the bake ran successfully. Will return false and print a warning message if it's not possible to start the bake. |

### Remarks

Returns when the lightmapping has finished. [Lightmapping.bakeStarted](/engine/6000.7/script-reference/unityeditor/lightmapping/bakestarted.md) will be called when the bake starts, and [Lightmapping.bakeCompleted](/engine/6000.7/script-reference/unityeditor/lightmapping/bakecompleted.md) when it is done.

Only works in [Lightmapping.GIWorkflowMode.OnDemand](/engine/6000.7/script-reference/unityeditor/lightmapping/giworkflowmode/ondemand.md) mode.

For asynchronous bakes see [Lightmapping.BakeAsync](/engine/6000.7/script-reference/unityeditor/lightmapping/bakeasync.md).
