Come collision stuff and stuff aand stuff hahahah

This commit is contained in:
Victor Turgeon
2023-06-11 12:54:09 -04:00
parent 004ba54cc0
commit 5ccf6a12ea
8 changed files with 74 additions and 91 deletions

View File

@@ -1,34 +1,18 @@
using Godot;
public enum TileTypes
{
NONE,
Grass,
Sand,
Water,
}
public partial class building_block : Node3D
{
[Export]
public RayCast3D _ray = null;
private RayCast3D _ground_ray;
[Export]
private TileTypes _compatible_tile = TileTypes.NONE;
private RayCast3D _collision_ray;
public bool IsPlaceable
{
get
{
if (_ray == null || _compatible_tile == TileTypes.NONE)
return false;
GodotObject collider = _ray.GetCollider();
GD.Print(collider);
if (collider == null)
return false;
return false;
return _collision_ray.GetCollider() == null && _ground_ray.GetCollider() != null && _ground_ray.GetCollider().GetType() == typeof(GridMap);
}
}
}