Essentially what I’m trying to build is an level editor for a board-game type environment, where the board is composed of connected tiles.
So, I’ve made a “SocketTile” actor, which has a static mesh with a series of sockets to represent where other tiles can be attached. Over each socket, I’ve attached a static mesh to act as an handle for other tools to interact with
For the tile placement tool, I figured I’d use the PlayerController’s GetHitResultUnderCursor, and test against the anchor meshes. Unfortunately, every time I run this, the only thing that is being spat out is the pawn behind the camera. Any advice on where I’m going wrong?
auto pc = UGameplayStatics::GetPlayerController(this, 0);
FHitResult hit;
if (pc->GetHitResultUnderCursor(ECollisionChannel::ECC_WorldDynamic , false, hit)){
pc->ClientMessage(hit.GetActor()->GetName());
}