How do i get a collision shapes height by raycast or area3d

Godot Version

4.2

Question

How do I get the height of a csg box or collision shape by a raycast/shapecastor area3d

This is for making a character that intecracts with stairs

I’m guessing you want the collision point of a cast. From there you can use the collision point’s Y coordinate to position the character/foot.

if cast.is_colliding():  # 'cast' is your RayCast3D or ShapeCast3D
    var intersection: Vector3 = cast.get_collision_point()

is_colliding() and get_collision_point() exist in 4.2 and for both types of casters.

If you are interested in more general discussion on interacting with stairs (specifically separation casts, example implementations) you could take a peek at this reddit thread.

Thanks, also would area 3d be roughly the same, or different

As an Area3D needs a CollisionObject3D to work, a cast will collide and interact with it the same :+1: