Download

Block placing and attaching like in minecraft.

Hello,
I am looking for solution to create block attaching system, like in minecraft. But i want to allow whole object created form blocks to be movable, so after attaching, all connect object should behave as one.
Anyone have any ideas how to start with it or maybe good tutorial? :smiley:

Propably i have solution but i ecounter a problem.
I used this to creat new block:
AVoxel* const Voxel = World->SpawnActor<AVoxel>(VoxelClass, Hit.Location, *NoRotation, SpawnParams);

and i try to attach new Voxel to Hit impact actor by:

Voxel->AttachRootComponentToActor(Hit.Actor);

but i getting error:
no suitable conversion function from “TWeakObjectPtr<AActor, FWeakObjectPtr, FIndexToObject>” to “AActor *”