C++ QuickStart on a Mac and 5.7

Has anyone got this to work with 5.7 on a Mac?
Everything compiles but FloatingActor has no mesh and hence is not visible in the Level.

Also, none of the Log warnings in the constructor seem to be firing.

This tutorial:

yes , it works on mac….

there is a bug that tutorial doesn’t check assets have been loaded or not, it’s easy to fix it :

void APickupBase::InitializePickup()

{
if( ! ensureAlways( ! PickupDataTable.IsNull() ) )
{
GEngine->AddOnScreenDebugMessage(-1, 16.f, FColor::Yellow, FString::Printf(TEXT(ā€œ%hs…PickupDataTable not setā€¦ā€) , _func_) );
return;
}

if( !PickupDataTable.IsValid() ){    // check assets here  šŸž
     PickupDataTable.LoadSynchronous();  **// load them in to memory if needed....🪲**
}

if (ensureAlways( !PickupItemID.IsNone() ) )
{
    // Retrieve the item data associated with this pickup from the Data Table
    const FItemData\* ItemDataRow = PickupDataTable->FindRow<FItemData>(PickupItemID, PickupItemID.ToString());

    UItemDefinition\* TempItemDefinition = ItemDataRow->ItemBase.Get();

        // Create a copy of the item with the class type
     ReferenceItem = TempItemDefinition->CreateItemCopy();


    // Check if the mesh is currently loaded by calling IsValid().
    if (TempItemDefinition->WorldMesh.IsValid()) {
        // Set the pickup's mesh to the associated item's mesh
        PickupMeshComponent->SetStaticMesh(TempItemDefinition->WorldMesh.Get());
    }
    else {
        // If the mesh isn't loaded, load it by calling LoadSynchronous().
        UStaticMesh\* WorldMesh = TempItemDefinition->WorldMesh.LoadSynchronous();
        PickupMeshComponent->SetStaticMesh(WorldMesh);
    }

    // Set the mesh to visible and collidable.
    PickupMeshComponent->SetVisibility(true);
    SphereComponent->SetCollisionEnabled(ECollisionEnabled::QueryOnly);

    // Register the Overlap Event
    SphereComponent->OnComponentBeginOverlap.AddDynamic(this, &APickupBase::OnSphereBeginOverlap);
}

}

Thank you, but this seems like you are addressing a different tutorial.

Also,why aren’t my Log calls executed?

Simple but painful solution.

After you compile new C++ code:

  1. Close Unreal
  2. Delete the Binaries folder
  3. Restart Unreal

Hardly a productive way to develop but it seems to work.

1 Like

Better Solution

This Icon Recompiles the C++ code!

if that button is hotreload or livecoding, beware it can create issues or corrupt bps on certain changes.

I think it is Live Coding.

What should I look out for?

So much of Unreal seems hidden and un or scarcely documented. I am trying C++ because Blueprints quickly become a sea of spaghetti!

i’m not exactly sure what that expression means. but you should be careful of

  • changing of class names, variable names.
  • adding/removing variables or classes.
  • renaming components.
  • enum also has issues since it changes the mangled name.

i would do those with a closed editor. though it’s still a bit risky.

changing the code inside a function is relatively safe.

you can reach the tutorial mentioned above here

LiveCoding is super handy if you know how it works, here is video explains how LiveCoding works , but it’s in chinese language.

(So yes , LiveCoding is for Advanced user)