Mouse button question

Hello guys!
Question is simple when I press left mouse button my character rotate just half way, but if I keep left mouse button down it rotates where it should. So How can I say if I press button once (not keeping it down) and do complete turn?

Thank you!

anyone know the answer?

you will have to provide us with screenshots of the blueprint. I do not know what you are trying to do or how you are trying to do it, I cannot give you any answer.

My bad, here is a BP screens:
first and second images are shoot ray and turn player
0bec989cf01f85d419f6960a52d8a6be95add602.jpeg
9741c213b916e0c797f9056f4f6d970afe033a88.jpeg
third image is calling above function
8bde6275c5d4b053afb624f881377c6e17f1ede9.jpeg

so when I click may player turn but just a small bit, if I keeping mouse button down player turn fully. I need that I pressed (not keeping button down) and player do full rotation.

Thanks

Alright, the problem is that the bool “Mouse Left Button Pressed” is set to false as soon as you stop pressing the button, wich mean that the function is not executed anymore and the rotation stop before finishing. I would recommend setting the bool “Mouse Left Button Pressed” to false only after you checked that the current rotation is equal to the target rotation in your Function.

Edit: Rinterp, or any interp, need to be executed at event tick for as long as the interp is not finished. Interp actually calculate of how much it should modify the current value toward the target value to get the interpolation to last the interp speed value, wich mean that the interp must be executed every tick.

Good point! I will try now, thank you.

no problem! Let me know if you get it to work.

so I got this

I can say its working but not working :smiley: If i clicked mouse button I need that mouse pointer stay in same position and wait till my player end turn and then it sets to false…

But how I said I need mouse button pressed > true and call function then mouse button > false (but function keep rotating till end). Hehe I don’t know how to explain hope you understand :smiley:

For the “==” node, I would have used a “equal(Rotator)” node instead and used it to compare the 2 rotators that you input into the 'Rinterp To" node. as for the mouse pointer… What mouse pointer?

mouse pointer I mean mouse position. Rinterp To I used for make slowly and nice rotation(dont know maybe better to use Lerp).

To better illustrate what I need and what I got so far here is vid:
[video]exapmle - YouTube

as you can see from video now when i press mouse button player turn and when turns complete sets to false but if rotation not complete video tells it all :smiley:

okay so you use the value “Mouse Left Button Pressed” elsewhere to update the target rotation and do not wish to update that target DURING the rotation. Well you need to:

-create a new bool Called, for example: “Ship is rotating” and set it to true when mouse button is pressed as well as “Mouse Left Button Pressed”
-Set “Mouse Left Button Pressed” to false when mouse button is released.
-On the branch, use the value “Ship is rotating” instead of “Mouse Left Button Pressed”
-when the rotation is finished, set “Ship is rotating” to false, instead of “Mouse Left Button Pressed”

Am I correct?

yea I did this but result is still the same as in video… it is harder then I thought :slight_smile:

hmmmm, the function that make that trace and update the target value only execute itself while “Mouse Left Button Pressed” is true, right?

so it should stop updating he target when you release the button, while the rotation Function keep executing until the second bool “Ship is rotating” is set to false by the function.

If that does not work I just don’t understand x)

I guess so (I new here so hard to tell I doing good way or wrong way). hope someone understand what is wrong in my BP :smiley:

Thank you JX53mb for your time and your solution!