I have a basic pickup and drop implemented for VR. I can’t for the left of me think how get round the problem of the player swapping items in the thier hands. If I move an item from left to right, its still classed as a left item, meaning the controls on the left motion controller will activate the item in the right!
You pickup with the trigger, drop with the grip. I want the trigger to be able to pick up the gun and then fire it for example, that part works OK. I’m using an interface to pass over the trigger for example to the actual item (there are two interfaces, one for each hand).
I am using an actor blueprint as a parent with one SM component and a SKM component. I make a child of this, add the appropriate meshes and blueprints to that, like the gun for example.
When I swap an item in my hands, two things go wrong. If I move from left to right, then the left hand controller still shoots because its still classed as a left hand item.
Second, if I collect the item in my left hand, swap it to the right hand and then drop it, the left hand still thinks it is holding an item and I have to press the grip to clear the bool even though there is nothing in my left hand anymore.
I hope this makes sense!
I know I only have to tell the game that the left hand item is now in the right hand, and clear that bool, but I have no idea how to set that up or where it should go. I’m guessing an == node and setting the left hand item as the right hand item and clearing the left hand.