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


in Engine by (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)

by (3,352 points)
selected by
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 Frequently asked questions and How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to [email protected] with your username.