Fix BuildingBlockCreator

This commit is contained in:
Sofia 2024-08-18 19:17:01 +03:00
parent 5fb268ac5d
commit c584dd1f92

View File

@ -4,8 +4,8 @@ namespace Gmtk24 {
public partial class BuildingBlockCreator : Node3D { public partial class BuildingBlockCreator : Node3D {
[Export] [Export]
public Node3D TrenchbroomMap; public Node3D TrenchbroomMap;
[Export] // [Export]
public PackedScene BuildingBlockPrefab; // public PackedScene BuildingBlockPrefab;
[Export] [Export]
public ShaderMaterial BuildingBlockMaterial; public ShaderMaterial BuildingBlockMaterial;
[Export] [Export]
@ -14,7 +14,7 @@ namespace Gmtk24 {
public override void _Ready() { public override void _Ready() {
var children = TrenchbroomMap.FindChildren("*_buildingblock"); var children = TrenchbroomMap.FindChildren("*_buildingblock");
foreach (var buildingBlockStaticBody in children) { foreach (var buildingBlockStaticBody in children) {
var buildingBlock = BuildingBlockPrefab.Instantiate(); var buildingBlock = new RigidBody3D();
var smallMesh = (MeshInstance3D)buildingBlockStaticBody.GetChild<MeshInstance3D>(0).Duplicate(); var smallMesh = (MeshInstance3D)buildingBlockStaticBody.GetChild<MeshInstance3D>(0).Duplicate();
smallMesh.Scale = Vector3.One * BuildingBlockScale; smallMesh.Scale = Vector3.One * BuildingBlockScale;