The As (T) node is used for performing certain types of conversions between compatible reference types.


Using example

In this example we will convert the Component type variable into the ParticleSystem type (which is derived from Component). Connect the component variable to the IN pin and the ParticleSystem to the out pin. The rest will be adjusted automatically.

In another example we will convert the object variable to a ParticleSystem.

Note: if the object variable doesn’t contain the ParticleSystem class instance, the result will be null. You can also check this before conversion using the “is” node.

Render time: 0.02 seconds
136,981 unique visits