Raising an actor by clicking directly on it and holding mouse button
I have managed, however inelegantly, to create a blueprint that allows me to raise a block (blueprint).
Now if I have one of these blocks I can raise it (and I've done a lower function as well, pretty much the same).
I have two issues:
Here's the construction script:
Here's the Event Graph section for raising the block:
And here's the Raise Ground Function:
What I'd ideally like to do is raise/lower any particular block whilst I'm clicking on it.
As a bonus, my goal is to have 25 of these blocks and when I click on the centre one it raises that one, then raises the surrounding blocks at a slower rate, and the blocks surrounding those raising at an even slower rate. Then I want to use the middle mouse button (or any other) to bring all the blocks surrounding the block clicked on into line whether raised or lowered.
I'm missing something key. Number 1 above is the priority. Still, any assistance would be appreciated.
asked Oct 08 '14 at 06:17 PM in Blueprint Scripting
The setup you have in the "nomousehelddown.png" is actually very close to what you're looking for. By adding a "Get Player Controller" node you can drag off of the return pin to add both the "Set Show Mouse Cursor" and "Set Enable Mouse Over Events" nodes as needed. Below is another image of mostly the same nodes from your image (I did use a Set Relative Location rather than Set Actor Relative Location) plus the nodes for showing the mouse and enabling mouse overlap events in the top right.
answered Oct 27 '14 at 07:18 PM
In your event graph for the raising of the block, you'll need to add a "Get Player Controller" node and wire off of that to a "Set Enable Mouse Over Events". You can then wire the input execution pin into your InputAction node. This will give you the behavior of only affecting the box when the mouse is held down while over it. This should also prevent any other boxes from reacting to the mouse input without the mouse overlapping them.
answered Oct 08 '14 at 06:46 PM
Follow this question
Once you sign in you will be able to subscribe for any updates here