Collision from StaticBody3D side

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

Hello,
I’m trying to get collision from StaticBody3D object and can’t find a way, as StaticBody does not have methods like is_colliding, or get_collision_bodies and such.

I’m making and RTS like building placement, where I move StaticBody3D under mouse in _physics_process method and I have to check if the place is free of collision or not to allow/disallow placement there.

Or might there be a better way to do this?

this ?

3D Voxel Demo - Godot Asset Library

ramazan | 2022-06-28 10:34

Thank you, but that’s unfortunately not what I’m trying to achieve.
In this demo, placement is done by finding surface under cursor and snaping a new block to it in a large grid of block’s size.

I’d like to avoid creating arbitrary grid for possible positions (snapping) and have it as a free placement on the ground, if possible.

IceExplosive | 2022-06-28 15:20

:bust_in_silhouette: Reply From: IceExplosive

Ah… got a little of wine and solved it today.

After receiving desired object to build (StaticBody3D) I have to create a new instance of Area3D, move all children from StaticBody to Area and then I can simply check for colliding bodies of that area.