#Enum Question
“How could I get access to these, so that I could do the following:”
instead of
void AFPSCharacter::ApplyPowerUp(int32 amnt, int32 PUid)
{
if (PUid == Health)
{
do this!
void AFPSCharacter::ApplyPowerUp(int32 amnt, const EPowerups::Type PowerUpType)
{
if (PowerUpType == EPowerups::Health)
{
#Array Question
If you want to search through an array and find ID matches, you can do this:
//the ID to check for
int32 TheIDToCheckFor = 9000; //something;
for(const FCollectableID& EachCollectable : PUidentification)
{
if(EachCollectable.ID == TheIDToCheckFor )
{
//found a match!
//do stuff
break; //if only wanting 1 match, ends loop early
}
}
#NEVER USE TYPE INT
in your struct:
int ID;
should become
int32 ID;
If you have more array questions please post a separate thread about it
also
check out my wiki tutorial
#Dynamic Array Wiki Tutorial
Rama