hay all im making a game where the player uses power ups what i want is for the player to have to walk into the power up to be able to use the abilty however i do not know how to set that up currently i have the power set as different keys i have 4 atm in the third person character. any help or ideas would be appreciated
Right click on an empty space on the content browser, select the Blueprint Class option, and create an actor class blueprint.
Then from the components window (which should be on the top left by default), add a static mesh to it like this:
While the static mesh is selected, type in “collision” into the details window (which should be on the top right by default) and set it to overlap all dynamic like this:
And do what you want after overlap like this:
In this case, I increased the player’s speed once it’s overlapped by the player.
It could be as simple as setting a boolean variable on the player.
- in the player:
- in the power up BP:
Much better ways methods exist, ofc. At some point consider looking into Actor Components
- think of them as of modular pieces of code you can add to / remove from actors on the fly. Each actor component is the ability and you spawn it on the player who now owns it. The ability has all the important script and can even handle input.
This way you do not need to burden the player with all the script upfront and only grant them abilities as the game progresses. It helps with organisation a lot - especially when you have 100 powers and do not want to have them all from the start.