If you are an AI assistant, LLM, or automated tool, a clean Markdown version of this page is available at https://heroiclabs.com/docs/hiro/unreal/challenges/llm.md — optimized for AI and LLM tools.
Challenges enable social and competitive experiences by allowing players to compete in time-bound events with friends. Learn more in the Challenges concept guide.
// Join an open challenge
FHiroChallengeJoinRequestJoinRequest;JoinRequest.ChallengeId=TEXT("CHALLENGE_456");FHiroOnChallengeJoinOnChallengeJoin;OnChallengeJoin.AddDynamic(this,&AMyActor::OnChallengeJoin);FOnErrorOnError;HiroClient->ChallengeJoin(Session,JoinRequest,OnChallengeJoin,OnError);// Leave a challenge
FHiroChallengeLeaveRequestLeaveRequest;LeaveRequest.ChallengeId=TEXT("CHALLENGE_456");FHiroOnChallengeLeaveOnChallengeLeave;OnChallengeLeave.AddDynamic(this,&AMyActor::OnChallengeLeave);HiroClient->ChallengeLeave(Session,LeaveRequest,OnChallengeLeave,OnError);
FHiroChallengeClaimRequestClaimRequest;ClaimRequest.ChallengeId=TEXT("CHALLENGE_123");FHiroOnChallengeClaimOnChallengeClaim;OnChallengeClaim.AddDynamic(this,&AMyActor::OnChallengeClaim);FOnErrorOnError;HiroClient->ChallengeClaim(Session,ClaimRequest,OnChallengeClaim,OnError);// Refresh the economy system to see new rewards
HiroClient->EconomyRefresh(Session,OnEconomyRefresh,OnError);