I need help with shape casting, I search in the documentation and I found nothing 😢. Does anyone knows how to shape casting?
How to Shape Casting?
Asked Answered
https://docs.godotengine.org/en/stable/classes/class_shapecast3d.html
Set shape, mask, body/area collision to what you need.
var shape_cast : ShapeCast3D
func create_shape_cast():
shape_cast = ShapeCast3D.new()
shape_cast.shape = SphereShape3D.new()
shape_cast.collide_with_areas = true
shape_cast.collide_with_bodies = true
shape_cast.collision_mask = 8
add_child(shape_cast)
func use_shape_cast(origin : Vector3, target_pos : Vector3 = Vector3(0,-1,0)):
if !shape_cast:
create_shape_cast()
shape_cast.global_position = origin
shape_cast.target_position = target_pos
# Check within the same physics update
shape_cast.force_shapecast_update()
if shape_cast.is_colliding():
print("colliding")
Hubbub thank you so much mate 🥹
© 2022 - 2024 — McMap. All rights reserved.