> For the complete documentation index, see [llms.txt](https://kinematicsoup.gitbook.io/scene-fusion/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://kinematicsoup.gitbook.io/scene-fusion/api-reference/ks.scenefusion.client.unity.editor/ks.scenefusion.client.unity.editor.sfgameobjecttranslator.md).

# Class sfGameObjectTranslator

Namespace: [KS.SceneFusion.Client.Unity.Editor](/scene-fusion/api-reference/ks.scenefusion.client.unity.editor.md)\
Assembly: KSUnity-Source.dll

Manages syncing of game objects.

```csharp
public class sfGameObjectTranslator : sfBaseUObjectTranslator
```

#### Inheritance

object ← [sfBaseTranslator](/scene-fusion/api-reference/ks.scenefusion.client.unity.editor/ks.scenefusion.client.unity.editor.sfbasetranslator.md) ← [sfBaseUObjectTranslator](/scene-fusion/api-reference/ks.scenefusion.client.unity.editor/ks.scenefusion.client.unity.editor.sfbaseuobjecttranslator.md) ← [sfGameObjectTranslator](/scene-fusion/api-reference/ks.scenefusion.client.unity.editor/ks.scenefusion.client.unity.editor.sfgameobjecttranslator.md)

#### Inherited Members

[sfBaseUObjectTranslator.m\_propertyChangeHandlers](/scene-fusion/api-reference/ks.scenefusion.client.unity.editor/ks.scenefusion.client.unity.editor.sfbaseuobjecttranslator.md#ks_scenefusion_client_unity_editor_sfbaseuobjecttranslator_m_propertychangehandlers), [sfBaseUObjectTranslator.PostPropertyChange](/scene-fusion/api-reference/ks.scenefusion.client.unity.editor/ks.scenefusion.client.unity.editor.sfbaseuobjecttranslator.md#ks_scenefusion_client_unity_editor_sfbaseuobjecttranslator_postpropertychange), [sfBaseUObjectTranslator.PostUObjectChange](/scene-fusion/api-reference/ks.scenefusion.client.unity.editor/ks.scenefusion.client.unity.editor.sfbaseuobjecttranslator.md#ks_scenefusion_client_unity_editor_sfbaseuobjecttranslator_postuobjectchange), [sfBaseUObjectTranslator.OnPropertyChange(sfBaseProperty)](/scene-fusion/api-reference/ks.scenefusion.client.unity.editor/ks.scenefusion.client.unity.editor.sfbaseuobjecttranslator.md#ks_scenefusion_client_unity_editor_sfbaseuobjecttranslator_onpropertychange_ks_scenefusion_sfbasepro), [sfBaseUObjectTranslator.OnRemoveField(sfDictionaryProperty, string)](/scene-fusion/api-reference/ks.scenefusion.client.unity.editor/ks.scenefusion.client.unity.editor.sfbaseuobjecttranslator.md#ks_scenefusion_client_unity_editor_sfbaseuobjecttranslator_onremovefield_ks_scenefusion_sfdictionary), [sfBaseUObjectTranslator.OnListAdd(sfListProperty, int, int)](/scene-fusion/api-reference/ks.scenefusion.client.unity.editor/ks.scenefusion.client.unity.editor.sfbaseuobjecttranslator.md#ks_scenefusion_client_unity_editor_sfbaseuobjecttranslator_onlistadd_ks_scenefusion_sflistproperty_s), [sfBaseUObjectTranslator.OnListRemove(sfListProperty, int, int)](/scene-fusion/api-reference/ks.scenefusion.client.unity.editor/ks.scenefusion.client.unity.editor.sfbaseuobjecttranslator.md#ks_scenefusion_client_unity_editor_sfbaseuobjecttranslator_onlistremove_ks_scenefusion_sflistpropert), [sfBaseUObjectTranslator.CreateObject(Object, string)](/scene-fusion/api-reference/ks.scenefusion.client.unity.editor/ks.scenefusion.client.unity.editor.sfbaseuobjecttranslator.md#ks_scenefusion_client_unity_editor_sfbaseuobjecttranslator_createobject_unityengine_object_system_st), [sfBaseUObjectTranslator.CallPropertyChangeHandlers(Object, sfBaseProperty, string)](/scene-fusion/api-reference/ks.scenefusion.client.unity.editor/ks.scenefusion.client.unity.editor.sfbaseuobjecttranslator.md#ks_scenefusion_client_unity_editor_sfbaseuobjecttranslator_callpropertychangehandlers_unityengine_ob), [sfBaseUObjectTranslator.CallPostPropertyChangeHandlers(Object, sfBaseProperty, string)](/scene-fusion/api-reference/ks.scenefusion.client.unity.editor/ks.scenefusion.client.unity.editor.sfbaseuobjecttranslator.md#ks_scenefusion_client_unity_editor_sfbaseuobjecttranslator_callpostpropertychangehandlers_unityengin), [sfBaseUObjectTranslator.CallPostUObjectChangeHandlers(Object)](/scene-fusion/api-reference/ks.scenefusion.client.unity.editor/ks.scenefusion.client.unity.editor.sfbaseuobjecttranslator.md#ks_scenefusion_client_unity_editor_sfbaseuobjecttranslator_callpostuobjectchangehandlers_unityengine), [sfBaseUObjectTranslator.OnSelect(sfObject, Object)](/scene-fusion/api-reference/ks.scenefusion.client.unity.editor/ks.scenefusion.client.unity.editor.sfbaseuobjecttranslator.md#ks_scenefusion_client_unity_editor_sfbaseuobjecttranslator_onselect_ks_scenefusion_client_sfobject_u), [sfBaseUObjectTranslator.OnDeselect(sfObject, Object)](/scene-fusion/api-reference/ks.scenefusion.client.unity.editor/ks.scenefusion.client.unity.editor.sfbaseuobjecttranslator.md#ks_scenefusion_client_unity_editor_sfbaseuobjecttranslator_ondeselect_ks_scenefusion_client_sfobject), [sfBaseUObjectTranslator.OnReplace(sfObject, Object, Object)](/scene-fusion/api-reference/ks.scenefusion.client.unity.editor/ks.scenefusion.client.unity.editor.sfbaseuobjecttranslator.md#ks_scenefusion_client_unity_editor_sfbaseuobjecttranslator_onreplace_ks_scenefusion_client_sfobject), [sfBaseTranslator.Initialize()](/scene-fusion/api-reference/ks.scenefusion.client.unity.editor/ks.scenefusion.client.unity.editor.sfbasetranslator.md#ks_scenefusion_client_unity_editor_sfbasetranslator_initialize), [sfBaseTranslator.OnSessionConnect()](/scene-fusion/api-reference/ks.scenefusion.client.unity.editor/ks.scenefusion.client.unity.editor.sfbasetranslator.md#ks_scenefusion_client_unity_editor_sfbasetranslator_onsessionconnect), [sfBaseTranslator.OnSessionDisconnect()](/scene-fusion/api-reference/ks.scenefusion.client.unity.editor/ks.scenefusion.client.unity.editor.sfbasetranslator.md#ks_scenefusion_client_unity_editor_sfbasetranslator_onsessiondisconnect), [sfBaseTranslator.TryCreate(Object, out sfObject)](/scene-fusion/api-reference/ks.scenefusion.client.unity.editor/ks.scenefusion.client.unity.editor.sfbasetranslator.md#ks_scenefusion_client_unity_editor_sfbasetranslator_trycreate_unityengine_object_ks_scenefusion_clie), [sfBaseTranslator.GetUObject(sfObject, Object)](/scene-fusion/api-reference/ks.scenefusion.client.unity.editor/ks.scenefusion.client.unity.editor.sfbasetranslator.md#ks_scenefusion_client_unity_editor_sfbasetranslator_getuobject_ks_scenefusion_client_sfobject_unitye), [sfBaseTranslator.OnCreate(sfObject, int)](/scene-fusion/api-reference/ks.scenefusion.client.unity.editor/ks.scenefusion.client.unity.editor.sfbasetranslator.md#ks_scenefusion_client_unity_editor_sfbasetranslator_oncreate_ks_scenefusion_client_sfobject_system_i), [sfBaseTranslator.OnConfirmCreate(sfObject)](/scene-fusion/api-reference/ks.scenefusion.client.unity.editor/ks.scenefusion.client.unity.editor.sfbasetranslator.md#ks_scenefusion_client_unity_editor_sfbasetranslator_onconfirmcreate_ks_scenefusion_client_sfobject), [sfBaseTranslator.OnDelete(sfObject)](/scene-fusion/api-reference/ks.scenefusion.client.unity.editor/ks.scenefusion.client.unity.editor.sfbasetranslator.md#ks_scenefusion_client_unity_editor_sfbasetranslator_ondelete_ks_scenefusion_client_sfobject), [sfBaseTranslator.OnConfirmDelete(sfObject, bool)](/scene-fusion/api-reference/ks.scenefusion.client.unity.editor/ks.scenefusion.client.unity.editor.sfbasetranslator.md#ks_scenefusion_client_unity_editor_sfbasetranslator_onconfirmdelete_ks_scenefusion_client_sfobject_s), [sfBaseTranslator.OnConfirmSubscription(sfObject, bool)](/scene-fusion/api-reference/ks.scenefusion.client.unity.editor/ks.scenefusion.client.unity.editor.sfbasetranslator.md#ks_scenefusion_client_unity_editor_sfbasetranslator_onconfirmsubscription_ks_scenefusion_client_sfob), [sfBaseTranslator.OnLock(sfObject)](/scene-fusion/api-reference/ks.scenefusion.client.unity.editor/ks.scenefusion.client.unity.editor.sfbasetranslator.md#ks_scenefusion_client_unity_editor_sfbasetranslator_onlock_ks_scenefusion_client_sfobject), [sfBaseTranslator.OnUnlock(sfObject)](/scene-fusion/api-reference/ks.scenefusion.client.unity.editor/ks.scenefusion.client.unity.editor.sfbasetranslator.md#ks_scenefusion_client_unity_editor_sfbasetranslator_onunlock_ks_scenefusion_client_sfobject), [sfBaseTranslator.OnLockOwnerChange(sfObject)](/scene-fusion/api-reference/ks.scenefusion.client.unity.editor/ks.scenefusion.client.unity.editor.sfbasetranslator.md#ks_scenefusion_client_unity_editor_sfbasetranslator_onlockownerchange_ks_scenefusion_client_sfobject), [sfBaseTranslator.OnDirectLockChange(sfObject)](/scene-fusion/api-reference/ks.scenefusion.client.unity.editor/ks.scenefusion.client.unity.editor.sfbasetranslator.md#ks_scenefusion_client_unity_editor_sfbasetranslator_ondirectlockchange_ks_scenefusion_client_sfobjec), [sfBaseTranslator.OnParentChange(sfObject, int)](/scene-fusion/api-reference/ks.scenefusion.client.unity.editor/ks.scenefusion.client.unity.editor.sfbasetranslator.md#ks_scenefusion_client_unity_editor_sfbasetranslator_onparentchange_ks_scenefusion_client_sfobject_sy), [sfBaseTranslator.OnPropertyChange(sfBaseProperty)](/scene-fusion/api-reference/ks.scenefusion.client.unity.editor/ks.scenefusion.client.unity.editor.sfbasetranslator.md#ks_scenefusion_client_unity_editor_sfbasetranslator_onpropertychange_ks_scenefusion_sfbaseproperty), [sfBaseTranslator.OnRemoveField(sfDictionaryProperty, string)](/scene-fusion/api-reference/ks.scenefusion.client.unity.editor/ks.scenefusion.client.unity.editor.sfbasetranslator.md#ks_scenefusion_client_unity_editor_sfbasetranslator_onremovefield_ks_scenefusion_sfdictionarypropert), [sfBaseTranslator.OnListAdd(sfListProperty, int, int)](/scene-fusion/api-reference/ks.scenefusion.client.unity.editor/ks.scenefusion.client.unity.editor.sfbasetranslator.md#ks_scenefusion_client_unity_editor_sfbasetranslator_onlistadd_ks_scenefusion_sflistproperty_system_i), [sfBaseTranslator.OnListRemove(sfListProperty, int, int)](/scene-fusion/api-reference/ks.scenefusion.client.unity.editor/ks.scenefusion.client.unity.editor.sfbasetranslator.md#ks_scenefusion_client_unity_editor_sfbasetranslator_onlistremove_ks_scenefusion_sflistproperty_syste), [sfBaseTranslator.OnSPropertyChange(sfObject, SerializedProperty)](/scene-fusion/api-reference/ks.scenefusion.client.unity.editor/ks.scenefusion.client.unity.editor.sfbasetranslator.md#ks_scenefusion_client_unity_editor_sfbasetranslator_onspropertychange_ks_scenefusion_client_sfobject), [sfBaseTranslator.OnSelect(sfObject, Object)](/scene-fusion/api-reference/ks.scenefusion.client.unity.editor/ks.scenefusion.client.unity.editor.sfbasetranslator.md#ks_scenefusion_client_unity_editor_sfbasetranslator_onselect_ks_scenefusion_client_sfobject_unityeng), [sfBaseTranslator.OnDeselect(sfObject, Object)](/scene-fusion/api-reference/ks.scenefusion.client.unity.editor/ks.scenefusion.client.unity.editor.sfbasetranslator.md#ks_scenefusion_client_unity_editor_sfbasetranslator_ondeselect_ks_scenefusion_client_sfobject_unitye)

## Methods

### ApplyHierarchyChanges() <a href="#ks_scenefusion_client_unity_editor_sfgameobjecttranslator_applyhierarchychanges" id="ks_scenefusion_client_unity_editor_sfgameobjecttranslator_applyhierarchychanges"></a>

Applies server hierarchy changes to the local hierarchy (new children and child order) for objects with server hierarchy changes.

```csharp
public void ApplyHierarchyChanges()
```

### ApplyHierarchyChanges(sfObject) <a href="#ks_scenefusion_client_unity_editor_sfgameobjecttranslator_applyhierarchychanges_ks_scenefusion_clien" id="ks_scenefusion_client_unity_editor_sfgameobjecttranslator_applyhierarchychanges_ks_scenefusion_clien"></a>

Applies server hierarchy changes to the local hierarchy (new children and child order) of an object.

```csharp
public void ApplyHierarchyChanges(sfObject parent)
```

#### Parameters

`parent` [sfObject](/scene-fusion/api-reference/ks.scenefusion.client/ks.scenefusion.client.sfobject.md)

parent to apply hierarchy changes to. This should be a scene or transform object.

### ApplyServerState(GameObject, bool) <a href="#ks_scenefusion_client_unity_editor_sfgameobjecttranslator_applyserverstate_unityengine_gameobject_sy" id="ks_scenefusion_client_unity_editor_sfgameobjecttranslator_applyserverstate_unityengine_gameobject_sy"></a>

Applies the server state to a game object and its components.

```csharp
public void ApplyServerState(GameObject gameObject, bool recursive = false)
```

#### Parameters

`gameObject` GameObject

gameObject to apply server state for.

`recursive` bool

if true, will also apply server state to descendants of the game object.

### ApplyServerState(sfObject, bool) <a href="#ks_scenefusion_client_unity_editor_sfgameobjecttranslator_applyserverstate_ks_scenefusion_client_sfo" id="ks_scenefusion_client_unity_editor_sfgameobjecttranslator_applyserverstate_ks_scenefusion_client_sfo"></a>

Applies the server state to a game object and its components.

```csharp
public void ApplyServerState(sfObject obj, bool recursive = false)
```

#### Parameters

`obj` [sfObject](/scene-fusion/api-reference/ks.scenefusion.client/ks.scenefusion.client.sfobject.md)

obj for the game object to apply server state for.

`recursive` bool

if true, will also apply server state to descendants of the game object.

### CanSyncObjectsWith(Component) <a href="#ks_scenefusion_client_unity_editor_sfgameobjecttranslator_cansyncobjectswith_unityengine_component" id="ks_scenefusion_client_unity_editor_sfgameobjecttranslator_cansyncobjectswith_unityengine_component"></a>

Checks if objects with the given component can be synced. Returns false if DontSyncObjectsWith was called with the component's type or one of its base types.

```csharp
public bool CanSyncObjectsWith(Component component)
```

#### Parameters

`component` Component

component to check.

#### Returns

bool

true if objects with the given component can be synced.

### CreateGuids(GameObject) <a href="#ks_scenefusion_client_unity_editor_sfgameobjecttranslator_createguids_unityengine_gameobject" id="ks_scenefusion_client_unity_editor_sfgameobjecttranslator_createguids_unityengine_gameobject"></a>

Iterates a game object and its descendants and creates deterministic guids for any game objects that do not have a guid.

```csharp
public void CreateGuids(GameObject gameObject)
```

#### Parameters

`gameObject` GameObject

### CreateObject(GameObject) <a href="#ks_scenefusion_client_unity_editor_sfgameobjecttranslator_createobject_unityengine_gameobject" id="ks_scenefusion_client_unity_editor_sfgameobjecttranslator_createobject_unityengine_gameobject"></a>

Recusively creates sfObjects for a game object and its children if they don't already exist. Does not modify existing objects.

```csharp
public sfObject CreateObject(GameObject gameObject)
```

#### Parameters

`gameObject` GameObject

gameObject to create sfObject for.

#### Returns

[sfObject](/scene-fusion/api-reference/ks.scenefusion.client/ks.scenefusion.client.sfobject.md)

created for the gameObject. Null if the game object already had an sfObject.

### DestroyGameObject(GameObject) <a href="#ks_scenefusion_client_unity_editor_sfgameobjecttranslator_destroygameobject_unityengine_gameobject" id="ks_scenefusion_client_unity_editor_sfgameobjecttranslator_destroygameobject_unityengine_gameobject"></a>

Destroys a game object and removes notifications from it and its descendants. Logs a warning if the game object could not be destroyed, which occurs in Unity 2022.1 and below if the game object is a prefab child instance. If the game object is the root of a prefab asset, does not destroy it or log a warning.

```csharp
public void DestroyGameObject(GameObject gameObject)
```

#### Parameters

`gameObject` GameObject

gameObject to destroy.

### DontSyncObjectsWith\<T>() <a href="#ks_scenefusion_client_unity_editor_sfgameobjecttranslator_dontsyncobjectswith__1" id="ks_scenefusion_client_unity_editor_sfgameobjecttranslator_dontsyncobjectswith__1"></a>

Prevents game objects with components of type T from syncing.

```csharp
public void DontSyncObjectsWith<T>() where T : Component
```

#### Type Parameters

`T`

### DontSyncObjectsWith(Type) <a href="#ks_scenefusion_client_unity_editor_sfgameobjecttranslator_dontsyncobjectswith_system_type" id="ks_scenefusion_client_unity_editor_sfgameobjecttranslator_dontsyncobjectswith_system_type"></a>

Prevents game objects with components of the given type from syncing.

```csharp
public void DontSyncObjectsWith(Type type)
```

#### Parameters

`type` Type

type of component whose game objects should not sync.

### GetChildGameObjects(sfObject) <a href="#ks_scenefusion_client_unity_editor_sfgameobjecttranslator_getchildgameobjects_ks_scenefusion_client" id="ks_scenefusion_client_unity_editor_sfgameobjecttranslator_getchildgameobjects_ks_scenefusion_client"></a>

Gets the child game objects of an sfObject's scene or transform.

```csharp
public List<GameObject> GetChildGameObjects(sfObject parent)
```

#### Parameters

`parent` [sfObject](/scene-fusion/api-reference/ks.scenefusion.client/ks.scenefusion.client.sfobject.md)

parent for the scene or transform to get child game objects from.

#### Returns

List\<GameObject>

children of the object. Null if the transform could not be found.

### GetPrefabPath(GameObject) <a href="#ks_scenefusion_client_unity_editor_sfgameobjecttranslator_getprefabpath_unityengine_gameobject" id="ks_scenefusion_client_unity_editor_sfgameobjecttranslator_getprefabpath_unityengine_gameobject"></a>

Gets the prefab path for a game object. If the game object has a sfMissingPrefab component, gets the path from that.

```csharp
public string GetPrefabPath(GameObject gameObject)
```

#### Parameters

`gameObject` GameObject

gameObject to get prefab info for.

#### Returns

string

prefab path, or null if the game object is not a prefab.

### Initialize() <a href="#ks_scenefusion_client_unity_editor_sfgameobjecttranslator_initialize" id="ks_scenefusion_client_unity_editor_sfgameobjecttranslator_initialize"></a>

Initialization

```csharp
public override void Initialize()
```

### InitializeGameObject(sfObject, Scene, bool) <a href="#ks_scenefusion_client_unity_editor_sfgameobjecttranslator_initializegameobject_ks_scenefusion_client" id="ks_scenefusion_client_unity_editor_sfgameobjecttranslator_initializegameobject_ks_scenefusion_client"></a>

Creates or finds a game object for an sfObject and initializes it with server values. Recursively initializes children.

```csharp
public GameObject InitializeGameObject(sfObject obj, Scene scene, bool createVariantsOfMissingPrefabs = false)
```

#### Parameters

`obj` [sfObject](/scene-fusion/api-reference/ks.scenefusion.client/ks.scenefusion.client.sfobject.md)

obj to initialize game object for.

`scene` Scene

scene the game object belongs to.

`createVariantsOfMissingPrefabs` bool

if true, will create a stand-in prefab variant with an sfMissingPrefab component for prefab variants of missing prefabs. If false, delays creating game objects for variants of missing prefabs until the next update, which prevents missing prefab notifications in cases where prefab B is a prefab variant of prefab A and prefab B syncs before prefab A.

#### Returns

GameObject

gameObject for the sfObject. Null if the game object could not be initialized.

### InitializeGameObjectHierarchy(sfObject, bool) <a href="#ks_scenefusion_client_unity_editor_sfgameobjecttranslator_initializegameobjecthierarchy_ks_scenefusi" id="ks_scenefusion_client_unity_editor_sfgameobjecttranslator_initializegameobjecthierarchy_ks_scenefusi"></a>

Creates or finds a game object for an sfObject and initializes it with server values. Recursively initializes children. Unlike InitializeGameObject, this will also place the game object in the correct hierarchy location. If the game object is located in the wrong child index, the child order will be synced in the next update.

```csharp
public GameObject InitializeGameObjectHierarchy(sfObject obj, bool createVariantsOfMissingPrefabs = false)
```

#### Parameters

`obj` [sfObject](/scene-fusion/api-reference/ks.scenefusion.client/ks.scenefusion.client.sfobject.md)

obj to initialize game object for.

`createVariantsOfMissingPrefabs` bool

if true, will create a stand-in prefab variant with an sfMissingPrefab component for prefab variants of missing prefabs. If false, delays creating game objects for variants of missing prefabs until the next update, which prevents missing prefab notifications in cases where prefab B is a prefab variant of prefab A and prefab B syncs before prefab A.

#### Returns

GameObject

gameObject for the sfObject. Null if the game object could not be initialized.

### InitializeGameObjectHierarchy(sfObject, int, bool) <a href="#ks_scenefusion_client_unity_editor_sfgameobjecttranslator_initializegameobjecthierarchy_ks_scenefusi" id="ks_scenefusion_client_unity_editor_sfgameobjecttranslator_initializegameobjecthierarchy_ks_scenefusi"></a>

Creates or finds a game object for an sfObject and initializes it with server values. Recursively initializes children. Unlike InitializeGameObject, this will also place the game object in the correct hierarchy location. If the game object is located in the wrong child index, the child order will be synced in the next update.

```csharp
public GameObject InitializeGameObjectHierarchy(sfObject obj, int childIndex, bool createVariantsOfMissingPrefabs = false)
```

#### Parameters

`obj` [sfObject](/scene-fusion/api-reference/ks.scenefusion.client/ks.scenefusion.client.sfobject.md)

obj to initialize game object for.

`childIndex` int

childIndex of the sfObject. -1 if it is a root.

`createVariantsOfMissingPrefabs` bool

if true, will create a stand-in prefab variant with an sfMissingPrefab component for prefab variants of missing prefabs. If false, delays creating game objects for variants of missing prefabs until the next update, which prevents missing prefab notifications in cases where prefab B is a prefab variant of prefab A and prefab B syncs before prefab A.

#### Returns

GameObject

gameObject for the sfObject. Null if the game object could not be initialized.

### IsSyncable(GameObject) <a href="#ks_scenefusion_client_unity_editor_sfgameobjecttranslator_issyncable_unityengine_gameobject" id="ks_scenefusion_client_unity_editor_sfgameobjecttranslator_issyncable_unityengine_gameobject"></a>

Checks if a game object can be synced. Objects can be synced if the following conditions are met:

* They are not hidden
* They can be saved in the editor
* They have no components that prevent the object from syncing. sfIngore, sfGuidList, or a component type that DontSyncObjectsWith was called with will prevent objects from syncing.
* They are not prefab stage objects.
* They are not prefab assets or prefab syncing is enabled.

```csharp
public bool IsSyncable(GameObject gameObject)
```

#### Parameters

`gameObject` GameObject

#### Returns

bool

true if the game object can be synced.

### IterateChildGameObjects(sfObject) <a href="#ks_scenefusion_client_unity_editor_sfgameobjecttranslator_iteratechildgameobjects_ks_scenefusion_cli" id="ks_scenefusion_client_unity_editor_sfgameobjecttranslator_iteratechildgameobjects_ks_scenefusion_cli"></a>

Iterates the child game objects of an sfObject's scene or transform.

```csharp
public IEnumerable<GameObject> IterateChildGameObjects(sfObject parent)
```

#### Parameters

`parent` [sfObject](/scene-fusion/api-reference/ks.scenefusion.client/ks.scenefusion.client.sfobject.md)

parent for the scene or transform to iterate.

#### Returns

IEnumerable\<GameObject>

### MarkHierarchyStale(GameObject) <a href="#ks_scenefusion_client_unity_editor_sfgameobjecttranslator_markhierarchystale_unityengine_gameobject" id="ks_scenefusion_client_unity_editor_sfgameobjecttranslator_markhierarchystale_unityengine_gameobject"></a>

If the game object is synced, adds its sfObject to the local hierarchy changed set to have its child order synced in the next pre update.

```csharp
public void MarkHierarchyStale(GameObject gameObject)
```

#### Parameters

`gameObject` GameObject

### MarkParentHierarchyStale(GameObject) <a href="#ks_scenefusion_client_unity_editor_sfgameobjecttranslator_markparenthierarchystale_unityengine_gameo" id="ks_scenefusion_client_unity_editor_sfgameobjecttranslator_markparenthierarchystale_unityengine_gameo"></a>

If the game object is synced, adds the game object's parent sfObject to the set of objects with local hierarchy changes to be synced in the next PreUpdate. If the sfObject is not synced but is syncable, adds the parent to the upload set to have new children uploaded in the next PreUpdate. If the game object is synced but the new parent is not, deletes the game object's sfObject.

```csharp
public void MarkParentHierarchyStale(GameObject gameObject)
```

#### Parameters

`gameObject` GameObject

### OnConfirmCreate(sfObject) <a href="#ks_scenefusion_client_unity_editor_sfgameobjecttranslator_onconfirmcreate_ks_scenefusion_client_sfob" id="ks_scenefusion_client_unity_editor_sfgameobjecttranslator_onconfirmcreate_ks_scenefusion_client_sfob"></a>

Called when a locally created object is confirmed as created.

```csharp
public override void OnConfirmCreate(sfObject obj)
```

#### Parameters

`obj` [sfObject](/scene-fusion/api-reference/ks.scenefusion.client/ks.scenefusion.client.sfobject.md)

obj that whose creation was confirmed.

### OnConfirmDelete(sfObject, bool) <a href="#ks_scenefusion_client_unity_editor_sfgameobjecttranslator_onconfirmdelete_ks_scenefusion_client_sfob" id="ks_scenefusion_client_unity_editor_sfgameobjecttranslator_onconfirmdelete_ks_scenefusion_client_sfob"></a>

Called when a locally-deleted game object is confirmed as deleted. If unsubscribed is true, removes the object and its descendants from the sfObjectMap. Otherwise clears properties on the object and its descendants, but keeps them in the sfObjectMap so they can be reused if the game object gets recreated so references to the objects will work.

```csharp
public override void OnConfirmDelete(sfObject obj, bool unsubscribed)
```

#### Parameters

`obj` [sfObject](/scene-fusion/api-reference/ks.scenefusion.client/ks.scenefusion.client.sfobject.md)

obj that was confirmed as deleted.

`unsubscribed` bool

true if the deletion occurred because we unsubscribed from the object's parent.

### OnCreate(sfObject, int) <a href="#ks_scenefusion_client_unity_editor_sfgameobjecttranslator_oncreate_ks_scenefusion_client_sfobject_sy" id="ks_scenefusion_client_unity_editor_sfgameobjecttranslator_oncreate_ks_scenefusion_client_sfobject_sy"></a>

Called when a game object is created by another user.

```csharp
public override void OnCreate(sfObject obj, int childIndex)
```

#### Parameters

`obj` [sfObject](/scene-fusion/api-reference/ks.scenefusion.client/ks.scenefusion.client.sfobject.md)

obj that was created.

`childIndex` int

childIndex of the new object. -1 if the object is a root.

### OnDelete(sfObject) <a href="#ks_scenefusion_client_unity_editor_sfgameobjecttranslator_ondelete_ks_scenefusion_client_sfobject" id="ks_scenefusion_client_unity_editor_sfgameobjecttranslator_ondelete_ks_scenefusion_client_sfobject"></a>

Called when a game object is deleted by another user.

```csharp
public override void OnDelete(sfObject obj)
```

#### Parameters

`obj` [sfObject](/scene-fusion/api-reference/ks.scenefusion.client/ks.scenefusion.client.sfobject.md)

obj that was deleted.

### OnDeselect(sfObject, Object) <a href="#ks_scenefusion_client_unity_editor_sfgameobjecttranslator_ondeselect_ks_scenefusion_client_sfobject" id="ks_scenefusion_client_unity_editor_sfgameobjecttranslator_ondeselect_ks_scenefusion_client_sfobject"></a>

Called when an game object is deselected. Releases the lock on the object if it is not being edited in a prefab stage.

```csharp
public override void OnDeselect(sfObject obj, Object uobj)
```

#### Parameters

`obj` [sfObject](/scene-fusion/api-reference/ks.scenefusion.client/ks.scenefusion.client.sfobject.md)

obj for the deselected game object.

`uobj` Object

uobj that was deselected.

### OnLock(sfObject) <a href="#ks_scenefusion_client_unity_editor_sfgameobjecttranslator_onlock_ks_scenefusion_client_sfobject" id="ks_scenefusion_client_unity_editor_sfgameobjecttranslator_onlock_ks_scenefusion_client_sfobject"></a>

Called when a game object is locked by another user.

```csharp
public override void OnLock(sfObject obj)
```

#### Parameters

`obj` [sfObject](/scene-fusion/api-reference/ks.scenefusion.client/ks.scenefusion.client.sfobject.md)

obj that was locked.

### OnLockOwnerChange(sfObject) <a href="#ks_scenefusion_client_unity_editor_sfgameobjecttranslator_onlockownerchange_ks_scenefusion_client_sf" id="ks_scenefusion_client_unity_editor_sfgameobjecttranslator_onlockownerchange_ks_scenefusion_client_sf"></a>

Called when a game object's lock owner changes.

```csharp
public override void OnLockOwnerChange(sfObject obj)
```

#### Parameters

`obj` [sfObject](/scene-fusion/api-reference/ks.scenefusion.client/ks.scenefusion.client.sfobject.md)

obj whose lock owner changed.

### OnParentChange(sfObject, int) <a href="#ks_scenefusion_client_unity_editor_sfgameobjecttranslator_onparentchange_ks_scenefusion_client_sfobj" id="ks_scenefusion_client_unity_editor_sfgameobjecttranslator_onparentchange_ks_scenefusion_client_sfobj"></a>

Called when a game object's parent is changed by another user.

```csharp
public override void OnParentChange(sfObject obj, int childIndex)
```

#### Parameters

`obj` [sfObject](/scene-fusion/api-reference/ks.scenefusion.client/ks.scenefusion.client.sfobject.md)

obj whose parent changed.

`childIndex` int

childIndex of the object. -1 if the object is a root.

### OnPrefabPathChange(GameObject, sfBaseProperty) <a href="#ks_scenefusion_client_unity_editor_sfgameobjecttranslator_onprefabpathchange_unityengine_gameobject" id="ks_scenefusion_client_unity_editor_sfgameobjecttranslator_onprefabpathchange_unityengine_gameobject"></a>

Called when a game object's prefab path is changed by the server.

```csharp
public void OnPrefabPathChange(GameObject gameObject, sfBaseProperty property)
```

#### Parameters

`gameObject` GameObject

gameObject whose prefab path changed.

`property` [sfBaseProperty](/scene-fusion/api-reference/ks.scenefusion/ks.scenefusion.sfbaseproperty.md)

property that changed. Null if the game object no longer has a prefab path.

### OnRemoveField(sfDictionaryProperty, string) <a href="#ks_scenefusion_client_unity_editor_sfgameobjecttranslator_onremovefield_ks_scenefusion_sfdictionaryp" id="ks_scenefusion_client_unity_editor_sfgameobjecttranslator_onremovefield_ks_scenefusion_sfdictionaryp"></a>

Called when a field is removed from a dictionary property.

```csharp
public override void OnRemoveField(sfDictionaryProperty dict, string name)
```

#### Parameters

`dict` [sfDictionaryProperty](/scene-fusion/api-reference/ks.scenefusion/ks.scenefusion.sfdictionaryproperty.md)

dict the field was removed from.

`name` string

name of the removed field.

### OnReplace(sfObject, Object, Object) <a href="#ks_scenefusion_client_unity_editor_sfgameobjecttranslator_onreplace_ks_scenefusion_client_sfobject_u" id="ks_scenefusion_client_unity_editor_sfgameobjecttranslator_onreplace_ks_scenefusion_client_sfobject_u"></a>

Called when a uobject is replaced with another uobject, which happens when we change the local file id of an asset. Removes the mapping for the sfObject and old uobject and maps the sfObject to the new uobject, updates the instance id map, and updates references from the old uobject to reference the new uobject.

```csharp
public override void OnReplace(sfObject obj, Object oldUObj, Object newUObj)
```

#### Parameters

`obj` [sfObject](/scene-fusion/api-reference/ks.scenefusion.client/ks.scenefusion.client.sfobject.md)

obj whose uobject was replaced.

`oldUObj` Object

`newUObj` Object

### OnSessionConnect() <a href="#ks_scenefusion_client_unity_editor_sfgameobjecttranslator_onsessionconnect" id="ks_scenefusion_client_unity_editor_sfgameobjecttranslator_onsessionconnect"></a>

Called after connecting to a session.

```csharp
public override void OnSessionConnect()
```

### OnSessionDisconnect() <a href="#ks_scenefusion_client_unity_editor_sfgameobjecttranslator_onsessiondisconnect" id="ks_scenefusion_client_unity_editor_sfgameobjecttranslator_onsessiondisconnect"></a>

Called after disconnecting from a session.

```csharp
public override void OnSessionDisconnect()
```

### OnUnlock(sfObject) <a href="#ks_scenefusion_client_unity_editor_sfgameobjecttranslator_onunlock_ks_scenefusion_client_sfobject" id="ks_scenefusion_client_unity_editor_sfgameobjecttranslator_onunlock_ks_scenefusion_client_sfobject"></a>

Called when a game object is unlocked by another user.

```csharp
public override void OnUnlock(sfObject obj)
```

#### Parameters

`obj` [sfObject](/scene-fusion/api-reference/ks.scenefusion.client/ks.scenefusion.client.sfobject.md)

obj that was unlocked.

### RelockPrefabNextPreUpdate(GameObject) <a href="#ks_scenefusion_client_unity_editor_sfgameobjecttranslator_relockprefabnextpreupdate_unityengine_game" id="ks_scenefusion_client_unity_editor_sfgameobjecttranslator_relockprefabnextpreupdate_unityengine_game"></a>

Relocks all game objects in a prefab instance on the next PreUpdate.

```csharp
public void RelockPrefabNextPreUpdate(GameObject gameObject)
```

#### Parameters

`gameObject` GameObject

gameObject in prefab to relock.

### SyncAll(GameObject, bool, bool, bool, bool) <a href="#ks_scenefusion_client_unity_editor_sfgameobjecttranslator_syncall_unityengine_gameobject_system_bool" id="ks_scenefusion_client_unity_editor_sfgameobjecttranslator_syncall_unityengine_gameobject_system_bool"></a>

Sends all changes for a game object and its components to the server, or reverts it to the server state if the object is locked. Optionally syncs changes for descendant game objects. Prefab source changes are only synced if descendants are synced recursively, as prefab source changes can change descendants and requires descendants to be synced. Game object creation and parent changes are synced in the next PreUpdate.

```csharp
public void SyncAll(GameObject gameObject, bool recursive = false, bool fixLockObjects = false, bool syncInstanceRevisions = true, bool acquireTempLock = true)
```

#### Parameters

`gameObject` GameObject

gameObject to sync all changes for.

`recursive` bool

`fixLockObjects` bool

if true, creates lock objects for game objects missing lock objects if their sfObject is locked, and deletes lock objects from game objects with unlocked sfObjects. Lock objects are used to render lock shaders. This is needed when syncing changes made by undo, which can mess up the lock state of game objects.

`syncInstanceRevisions` bool

`acquireTempLock` bool

### SyncChangedHierarchies() <a href="#ks_scenefusion_client_unity_editor_sfgameobjecttranslator_syncchangedhierarchies" id="ks_scenefusion_client_unity_editor_sfgameobjecttranslator_syncchangedhierarchies"></a>

Sends hierarchy changes (new children and child order) for objects with local hierarchy changes. If the children are locked, reverts them to their server location.

```csharp
public void SyncChangedHierarchies()
```

### SyncDestroyedChildren(GameObject) <a href="#ks_scenefusion_client_unity_editor_sfgameobjecttranslator_syncdestroyedchildren_unityengine_gameobje" id="ks_scenefusion_client_unity_editor_sfgameobjecttranslator_syncdestroyedchildren_unityengine_gameobje"></a>

Destroys server objects for destroyed children of a game object. Recreates the game object if the objects are locked.

```csharp
public void SyncDestroyedChildren(GameObject gameObject)
```

#### Parameters

`gameObject` GameObject

gameObject to sync destroyed children for.

### SyncHierarchy(sfObject) <a href="#ks_scenefusion_client_unity_editor_sfgameobjecttranslator_synchierarchy_ks_scenefusion_client_sfobje" id="ks_scenefusion_client_unity_editor_sfgameobjecttranslator_synchierarchy_ks_scenefusion_client_sfobje"></a>

Sends hierarchy changes (new children and child order) for an object to the server. If the children are locked, reverts them to their server location.

```csharp
public void SyncHierarchy(sfObject parent)
```

#### Parameters

`parent` [sfObject](/scene-fusion/api-reference/ks.scenefusion.client/ks.scenefusion.client.sfobject.md)

### SyncHierarchyNextUpdate(sfObject) <a href="#ks_scenefusion_client_unity_editor_sfgameobjecttranslator_synchierarchynextupdate_ks_scenefusion_cli" id="ks_scenefusion_client_unity_editor_sfgameobjecttranslator_synchierarchynextupdate_ks_scenefusion_cli"></a>

Sends hierarchy changes (new children and child order) for an object to the server on the next update. If the children are locked, reverts them to their server location.

```csharp
public void SyncHierarchyNextUpdate(sfObject parent)
```

#### Parameters

`parent` [sfObject](/scene-fusion/api-reference/ks.scenefusion.client/ks.scenefusion.client.sfobject.md)

### SyncProperties(GameObject, bool) <a href="#ks_scenefusion_client_unity_editor_sfgameobjecttranslator_syncproperties_unityengine_gameobject_syst" id="ks_scenefusion_client_unity_editor_sfgameobjecttranslator_syncproperties_unityengine_gameobject_syst"></a>

Sends property changes for a game object and its components to the server. Reverts them to the server state if the object is locked.

```csharp
public void SyncProperties(GameObject gameObject, bool recursive = false)
```

#### Parameters

`gameObject` GameObject

gameObject to sync properties for.

`recursive` bool

if true, will recursively sync properties for child game objects.

### TempUnlock(GameObject) <a href="#ks_scenefusion_client_unity_editor_sfgameobjecttranslator_tempunlock_unityengine_gameobject" id="ks_scenefusion_client_unity_editor_sfgameobjecttranslator_tempunlock_unityengine_gameobject"></a>

Temporarily unlocks a game object, and relocks it on the next update.

```csharp
public void TempUnlock(GameObject gameObject)
```

#### Parameters

`gameObject` GameObject

gameObject to unlock temporarily.

### TryCreate(Object, out sfObject) <a href="#ks_scenefusion_client_unity_editor_sfgameobjecttranslator_trycreate_unityengine_object_ks_scenefusio" id="ks_scenefusion_client_unity_editor_sfgameobjecttranslator_trycreate_unityengine_object_ks_scenefusio"></a>

If uobj is a syncable game object, creates an empty sfObject without uploading it and maps it to the game object in the sfObjectMap. If the game object is the root of a prefab, also creates the properties for it and uploads it.

```csharp
public override bool TryCreate(Object uobj, out sfObject outObj)
```

#### Parameters

`uobj` Object

uobj to create sfObject for.

`outObj` [sfObject](/scene-fusion/api-reference/ks.scenefusion.client/ks.scenefusion.client.sfobject.md)

outObj created for the uobject.

#### Returns

bool

true if the uobject was handled by this translator.

### OnLockStateChange <a href="#ks_scenefusion_client_unity_editor_sfgameobjecttranslator_onlockstatechange" id="ks_scenefusion_client_unity_editor_sfgameobjecttranslator_onlockstatechange"></a>

Invoked when a game object's lock state changes.

```csharp
public event sfGameObjectTranslator.OnLockStateChangeHandler OnLockStateChange
```

#### Event Type

[sfGameObjectTranslator](/scene-fusion/api-reference/ks.scenefusion.client.unity.editor/ks.scenefusion.client.unity.editor.sfgameobjecttranslator.md).[OnLockStateChangeHandler](/scene-fusion/api-reference/ks.scenefusion.client.unity.editor/ks.scenefusion.client.unity.editor.sfgameobjecttranslator/ks.scenefusion.client.unity.editor.sfgameobjecttranslator.onlockstatechangehandler.md)

### OnMissingPrefab <a href="#ks_scenefusion_client_unity_editor_sfgameobjecttranslator_onmissingprefab" id="ks_scenefusion_client_unity_editor_sfgameobjecttranslator_onmissingprefab"></a>

Invoked when a prefab game object instance with a missing prefab asset is found. This is not the same as a prefab stand-in (a game object with a sfMissingPrefab component).

```csharp
public event sfGameObjectTranslator.MissingPrefabHandler OnMissingPrefab
```

#### Event Type

[sfGameObjectTranslator](/scene-fusion/api-reference/ks.scenefusion.client.unity.editor/ks.scenefusion.client.unity.editor.sfgameobjecttranslator.md).[MissingPrefabHandler](/scene-fusion/api-reference/ks.scenefusion.client.unity.editor/ks.scenefusion.client.unity.editor.sfgameobjecttranslator/ks.scenefusion.client.unity.editor.sfgameobjecttranslator.missingprefabhandler.md)
