0 votes

I got a kinematicBody2D with an animatedsprite as child. I use $animatedsprite.scale.x = ...
to change its size, but what can I do to change the KinematicBody2D's size? (it is the main parent of the scene)

in Engine by (55 points)

1 Answer

0 votes

You can go to the Transform option under Node 2D which is on your right Inspector Window and further Scale your Sprites easily

by (403 points)

How can I do that with code?

I don't understand though. Lets say you're increasing the size of your sprite, you should simply increase the collision shape along with the increased sprite. I am also pretty new but hey, maybe you want to do something cool. As far as I'm concerned I don't think there's any way you can increase size of Kinematic body, after all it requires a sprite and a collision shape as two of the important parts. Increasing them both should do the trick. Can you tell what exactly it is that you're trying to do ?
You should try increasing you Collision Shape along with the sprite using :

$CollisionShape2D.scale.x = Any value
$CollisionShape2D.scale.y = Any value 
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.
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 webmaster@godotengine.org with your username.