# CreateInSceneAssetFromAsset(Object, GameObject)

> Creates an in-scene asset object from the given project asset.

## Definition

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

```csharp
public static Object CreateInSceneAssetFromAsset(Object asset, GameObject gameObjectReferencingAsset)
```

### Parameters

**** (\[Object]\(/engine/6000.6/script-reference/unityengine/object)): The persistent asset to convert to an in-scene asset.**** (\[GameObject]\(/engine/6000.6/script-reference/unityengine/gameobject)): The GameObject that is referencing the asset either directly or through its children in its hierarchy.

### Returns

| Type                                                            | Description                                                                                        |
| --------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- |
| [Object](/engine/6000.6/script-reference/unityengine/object.md) | An in-scene asset object referenced by `gameObjectReferencingAsset` if successful, otherwise null. |

### Remarks

Given a project asset and a GameObject referencing it, the function clones the asset, makes it non-persistent and remaps the GameObject's references to the new in-scene asset object.

Additional Resources: [InSceneAssetUtility.CreateAssetFromInSceneAsset](/engine/6000.6/script-reference/unityeditor/insceneassetutility/createassetfrominsceneasset.md).
