Come collision stuff and stuff aand stuff hahahah
This commit is contained in:
@@ -47,7 +47,7 @@ public partial class player : Camera3D
|
||||
}
|
||||
}
|
||||
|
||||
public Node3D CurrentBuilding { get; set; }
|
||||
public base_building CurrentBuilding { get; set; }
|
||||
|
||||
public override void _Ready()
|
||||
{
|
||||
@@ -55,8 +55,7 @@ public partial class player : Camera3D
|
||||
game_manager.CurrentState = game_manager.State.Building;
|
||||
if (_test_building != null)
|
||||
{
|
||||
CurrentBuilding = _test_building.Instantiate<Node3D>();
|
||||
GD.Print(CurrentBuilding);
|
||||
CurrentBuilding = _test_building.Instantiate<base_building>();
|
||||
|
||||
GetTree().Root.CallDeferred("add_child", CurrentBuilding);
|
||||
}
|
||||
@@ -156,8 +155,11 @@ public partial class player : Camera3D
|
||||
|
||||
if (Input.IsActionJustPressed("build"))
|
||||
{
|
||||
Node3D tempBuilding = (Node3D)CurrentBuilding.Duplicate();
|
||||
GetTree().Root.CallDeferred("add_child", tempBuilding);
|
||||
if (CurrentBuilding.IsPlaceable)
|
||||
{
|
||||
base_building tempBuilding = (base_building)CurrentBuilding.Duplicate();
|
||||
GetTree().Root.CallDeferred("add_child", tempBuilding);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user