Skip to content

Commit

Permalink
Chunk actor reference added to chunk world
Browse files Browse the repository at this point in the history
  • Loading branch information
BLaZeKiLL committed Jun 11, 2021
1 parent fe4f612 commit 67ee34b
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 7 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@ Binaries
DerivedDataCache
Intermediate
Saved
Plugins/Developer/RiderLink
.vscode
.vs
.idea
*.VC.db
*.opensdf
*.opendb
Expand Down
4 changes: 2 additions & 2 deletions Config/DefaultEngine.ini
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@


[/Script/EngineSettings.GameMapsSettings]
GameDefaultMap=/Engine/Maps/Templates/Template_Default.Template_Default

GameDefaultMap=/Game/Main.Main
EditorStartupMap=/Game/Main.Main

[/Script/HardwareTargeting.HardwareTargetingSettings]
TargetedHardwareClass=Desktop
Expand Down
4 changes: 2 additions & 2 deletions Content/Main.umap
Git LFS file not shown
2 changes: 1 addition & 1 deletion Content/Main_BuiltData.uasset
Git LFS file not shown
3 changes: 1 addition & 2 deletions Source/UE5VoxelTutorial/Private/ChunkWorld.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@

#include "ChunkWorld.h"

#include "Chunk.h"

// Sets default values
AChunkWorld::AChunkWorld()
Expand All @@ -21,7 +20,7 @@ void AChunkWorld::BeginPlay()
{
for (int y = -DrawDistance; y < DrawDistance; ++y)
{
GetWorld()->SpawnActor<AChunk>(FVector(x * ChunkSize * 100, y * ChunkSize * 100, 0), FRotator(0,0,0));
GetWorld()->SpawnActor<AActor>(Chunk,FVector(x * ChunkSize * 100, y * ChunkSize * 100, 0), FRotator(0,0,0));
}
}
}
3 changes: 3 additions & 0 deletions Source/UE5VoxelTutorial/Private/ChunkWorld.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ class AChunkWorld : public AActor
GENERATED_BODY()

public:
UPROPERTY(EditAnywhere, Category="Chunk World")
TSubclassOf<AActor> Chunk;

UPROPERTY(EditAnywhere, Category="Chunk World")
int DrawDistance = 5;

Expand Down

0 comments on commit 67ee34b

Please sign in to comment.