# Support for Object Reference Properties

It is possible to assign object reference data types to script properties. Once a script has been assigned to a script component, the property panel of the ScriptComponent is populated with properties exposed by the Script. Dragging an object on a ScriptComponent would set a reference property, if any reference property of the dragged object type is exposed by the ScriptComponent.

<p class="callout info">When defining reference parameters in the Script, they become available on every script component that uses that script. Each reference parameters has a tooltip indicating where to attach items from.  
</p>

Scripts already support a number of property types to be configured in SceneComposer. Candera ScriptSystem has additional support for using CanderaObject references inside scripts.

>  return {  
>     Init = Init,  
>     Update = Update,  
>     rotateValue = 3.0,  
>     GetName = GetName  
>     }

As can be noticed in the example above, a float property used in a script results in a editable dynamic property:

<div drawio-diagram="6464"><img src="https://doc316en.candera.eu/uploads/images/drawio/2024-07/drawing-5-1721983786.png" alt=""/></div>

In a similar way, a reference property should be configurable in the property panel:

<div drawio-diagram="415"><img src="https://doc316en.candera.eu/uploads/images/drawio/2023-02/drawing-7-1676350403.png" alt=""/></div>

shall result in:

<div drawio-diagram="6466"><img src="https://doc316en.candera.eu/uploads/images/drawio/2024-07/drawing-5-1721983931.png" alt=""/></div>

---

#### Supported References  


The following references are supported:

- Animation and AnimationGroups (from solution. control node animations are not supported)
- Appearance and Appearance collections (from the solution. Appearance collection is preferred to have instance sharing enabled). Appearances/Appearance collections attached to nodes are not supported
- 3D camera
- 3D light
- 3D node (any type)
- 2D camera
- 2D node (any type)
- RenderTarget (must be a 3D render target type)

<p class="callout info">Reference parameters are not editable when pausing the script (only the value ones). References inside controls are not supported. </p>

---