Hey dude. Try using the Do Once node to limit the execution to only fire once. The Reset input on that node is used to allow another execution to pass through, so when you’re allowing another pickup, also reset the node.
Thanks for the reply, im not sure as to where to put it however
Well, I don’t know what you’ve got going on elsewhere in the blueprint, but you should put it just after the action or event that should only fire once.
How are you acquiring your target?
Its from one of the new official youtube tutorials “interacting with objects” or something, it uses a trace using left mouse button, the problem i have is that left mouse button does both picking up the object AND dropping the object back down, so if i have it picked up and then try and click on a new object, that means that the click is registering for both objects, i only want to pickup one at a time.
If you’re holding the object, your Can Pickup boolean variable is false. You need to check if that variable is true before you allow a new target to be selected (I’m assuming you’re using a line trace like the tutorial).
What I would do is keep a reference to what actor you’re currently holding. Create a new variable of type Actor called CurrentObject or something appropriate. Then, when you pick up an object, also set CurrentObject to the target actor. On the event Left Mouse Button you check Can Pickup . If it is false, then your mouse click should only drop the current object, and only if it’s true will you do a line trace for a new object.
Take a look at this screenshot. I couldn’t fully setup your scenario because my actor variable doesn’t have physics to set.
Imagine a connection between Current Object Held and Set Simulate Physics.
Thanks mate, ill look into that tomorrow better get some sleep now
I’m trying to make the same thing but to move the camera instead. What shall I change to get that working?
im sorry to ask such a simple question but what us the set [can rotate ] variable n how to set it up…im a newbie and thanks in advance
In your blueprint editor window, there is a section for variables. You can add a variable there, and give it a name. I named mine “Can Rotate”. I set the type of the variable to bool. You can drag variables out onto the event graph, and click “set” or “get” to add a node that will “set” the value of the variable, or “get” the value of the variable. You can also right click on the event graph and type the name of the variable to find it.
I would highly recommend watching the Unreal Engine youtube tutorials. Blueprint Essentials: Variables Overview | 01 | v4.2 Tutorial Series | Unreal Engine - YouTube