How to change height of a collisionshape box in gdscript?

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

How to change the height, or scale of a box that is used as a collisionshape for a fps character in gdscript? Might be a stupid question, but I am new and couldnt find anything in the docs or a similar question to mine as they are all about 2D and not 3D
Thanks for every answer

:bust_in_silhouette: Reply From: SteveSmith

Something like this:-

var shape: RectangleShape2D = $Node/CollisionShape2D.shape
shape.extends.x += 10

And how is that for 3d? Change the 2d to 3d lr are there other calls?

Recho890 | 2022-12-23 11:44

It’s pretty much exactly the same:-

var shape: BoxShape = $Node/CollisionShape.shape
shape.extents.x += 10

SteveSmith | 2022-12-23 12:13