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