How to make an pickup item to increase the attack damage of the main character

Hello, does anyone knows how to make an pickable item that buffs the character attack damage for a certain amount of time and then returns to normal. in blueprint or c++.

the best way would be to create a modular status effect system that can handle other effects later, likely using actor components

the simplest way if you’re not confident with that is to create a function tha increases strength and then set timer but event and when that timer completes remove the buff

1 Like

Hey there @ibro418! Welcome to the community! Here’s a tutorial for a very basic buff system:

Disclaimer: One or more of these links are unaffiliated with Epic Games. Epic Games is not liable for anything that may occur outside of this Unreal Engine domain. Please exercise your best judgment when following links outside of the forums.

(post deleted by author)

Hello, does anyone knows how to make an pickable item that buffs the character attack damage for a certain amount of time and then returns to normal. in blueprint or c++.

There are actually many things going on in your description and details missing. Several steps would need to be figured out. The Solution for each step can potential solve another problem.

Thus, I would break process down into smaller steps and solve each one at a time. Lets start with the first problem:

“Make an pickable item”

How is the item visualized?

  1. Text
  2. 2D Image
  3. 3D Mesh

How does the Player interact with Item?

  1. Clicking it with a mouse
  2. Pressing a key while hovering over with
  3. Colliding with Character
  4. Colliding within a distance from Character
  5. Colliding with Projectile
  6. Some combination of all of the above

If conditions permit, I hope you can learn from EPIC’s official GameAbilitysystem. Increasing attack power within this framework is very easy, just adding a GameEffect
The following are unofficial GAS documents:

The item will be visualized in 3D Mesh and the player can interact with it by colliding with the character

I would start by creating a ‘Trigger’ Actor BP Class with a CollisionShape Component (Box, Capsule, Sphere) and add a Mesh Component (Static or Skeletal). The CollisionShape’s job is to fire off an event when collision is detected between itself and other another Actor component. The Mesh Component’s job is display the Object’s Visual. Once you have a Trigger Actor set up, you can wire up the Event to do anything when collision occurs.

When the collision is detected, you’ll some critical info: You’ll get the Actor and specific component involved in the collision. Once you have this info, you can provide to event to do something to the Actor/component that collided with the trigger. ie buffs the character attack damage.