I’m trying to make my character NOT pick up a weapon (in this case the BP_Rifle) if he already has one in hand.
What happens now is that every time the player walks on the Rifle, he will pick it up and the weapon will be duplicated in his hands (I’m shooting two balls instead of one).
This is what I did.
So you’ll want to set a bool on your character saying whether or not a gun is in their hand, or some other variable (usually people use a custom ENUM with each weapon being an option). Then you’ll use your first person reference, “Get” that variable, and use THAT to check your branch like you’re already doing, just replace the variable with the one from First Person Char Ref.
I can’t seem to make it work but I think I’m close.
I want to keep the OnComponentBeginOverlap of the Rifle and from there verify if the Character is already holding one or not.
I did an Enum in the Character (equipped, not quipped) however, I’m still stuck on the communication between the Blueprints.
Thats what I had in mind:
The Character is set to NotEquipped by the Enum.
As the Chracter overlaps with the BP_Rifle, the Rifle verifies if the Character is equipped or not.
If Equipped, do nothing. If NotEquipped, equip Rifle.
It should be simple but I may not know enough yet to understand what’s not working.
If you have some other tips I’ll take them. In the mean time I’ll try to find some doc for Blueprint communication. I spent way too much time on this XD.
This is the default 1st person template. All I did was add the branch to check for the bool and make the actor do something if true. Everything else you can check out by creating a project with the template.
I knew it had to be something stupid like that haha.
Thanks a lot. This is Exactly what I was looking to do. Most videos were showing Pickup and Grab event, which I dont need. The anim with the rifle turning red is pretty cool.