![]() |
Attention | Topic was automatically imported from the old Question2Answer platform. |
![]() |
Asked By | MarcPhi |
Hello i have a gridmap with tiles in different sizes. The user can set cells in this gridmap, but I need to check if the space is occupied before (a tile can reach over to other tiles).
I tried to use an area, but areas can’t detect the collision of staticbodys from a meshlib.
Is there any easy solution or do I need to use raycasts?
Have you tried looking into simple collision detection? For example, I’ve toyed with axis-aligned bounding boxes (AABB). If you can, get an AABB for the potential spot in theGridMap
and check it against what the user wants to place there.
Ertain | 2020-05-28 23:43
any other links? i dont understand your idea
MarcPhi | 2020-05-29 00:51
You wrote that the collisions of Area
s can’t detect the StaticBody
s of the GridMap
cells. Why not have an AABB (the 3D equivalent of the Rect2
) which takes the place of any currently-occupied spaces? When a user tries to place a cell in some location, first check the AABB of the potential cell against what may be currently occupying that location.
Ertain | 2020-05-29 04:23
Did you find a solution for it ?
ATHellboy | 2021-12-08 18:16