0 votes

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

asked Mar 4, 2019 in Engine by arucardlestad (23 points)

1 Answer

+1 vote
Best answer

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)

answered Mar 4, 2019 by wombatstampede (2,879 points)
selected Mar 4, 2019 by arucardlestad
Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read How to use this Q&A? before posting your first questions.