how to access properties from code?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By arucardlestad

Hi, I have a basic question here. I want to modify the Scale of t KinematicBody through code. How do I access the scale property? I think this property is in KinematicBody.Spatial.Scale(10) but this is not working

Thanks

:bust_in_silhouette: Reply From: wombatstampede

A 3D object like KinematicBody has a Vector3 as scale (you also see 3 values in the transform scale section of the Editor). This is common for all scales.

KinematicBody is derived from Spatial. Therefore it has all properties of Spatial.

If your node is named “KinematicBody1” then this example should set the scale to 10 in all dimensions:
$KinematicBody1.scale=Vector3(10.0, 10.0, 10.0)