Advertisement

I would really appreciate some help with implementing the Inventory and pickup system in Tom Looman's Survival game.

Started by January 29, 2020 12:20 PM
2 comments, last by DoomOperator 4 years, 9 months ago

(SOLVED) Hello there lovely people at Game Dev. I am trying to Incorporate the inventory system and the pickup system. All i wish to achieve is the effect seen in the “Survival Game” From GitHub. I wish to have the weapon be picked up from the trace line and then go into the characters hand or back, the issue i am having is that instead of the weapon spawning at the socket on my character is spawns in the middle of the world/Map. Can someone please help?
I'm not sure what is going wrong here. There is a video showing my problem in the link below to my game dev page.

This Video is short. I will appreciate all the help i can get, have been trying to work on a C++ only inventory for weeks now. :/

This Code Below i thought would explain my issue but it doesn't.

My compiler shows no errors either.

void AArtifact::AttachMeshToPawn(EInventorySlot Slot)

{

if (MyPawn)

{

// Remove and hide

DetachMeshFromPawn();

USkeletalMeshComponent* PawnMesh = MyPawn->GetMesh();

// This Get's the Inventory socket name for attachments to match with the inventory socket

FName AttachPoint = MyPawn->GetInventoryAttachPoint(Slot);

Mesh->SetHiddenInGame(false);

Mesh->AttachToComponent(PawnMesh, FAttachmentTransformRules::SnapToTargetNotIncludingScale, AttachPoint);

//Mesh->SetupAttachment(PawnMesh, AttachPoint);

}

}

I'm doing this for my own learning purposes.

SOLVED NOTE: I solved my problem by adding in the Cpp files for the AddWeapon and RemoveWeapon functions found in this game. it was the one thing i failed to implement ?

Hello Doom Operator,

have you tried looking at the Inventory System template available at the Unreal Marketplace? It is free for this month and it might help you greatly.

https://www.unrealengine.com/marketplace/en-US/product/arpg-inventory-system

Advertisement

@Tomato Head Hey Tomato Head, Thank you for your suggestion. I am downloading it now. I am trying to implement my Inventory system in C++ Only for maximum performance and for future expansion. I believe the this RPG inventory won't be what i need as it seems to be a blueprint add on. I will have a look though, see what i can do.

This topic is closed to new replies.

Advertisement