0 votes

hello
i need help
i want to change the size of my collision shape in script
can you help me

asked May 26 in Engine by sphixy011 (42 points)

1 Answer

+1 vote
Best answer

It depends on what shape you're using. Each of the Shape2D objects has its own properties. For example, radius for CircleShape2D or extents for RectangleShape2D.

As an example, if you have a CollisionShape2D with a RectangleShape2D as its shape:

$CollisionShape2D.shape.extents = Vector2(x, y)

or a circle shape:

$CollisionShape2D.shape.radius = some_value
answered May 26 by kidscancode (16,966 points)
selected May 27 by sphixy011
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.