0
\$\begingroup\$

I created an Action Mapping using the right mouse button as a reference.

The Action Map is called "Andar" (walk in english).

In the character code, I call this Action Mapping and in it I make the character walk by clicking the right mouse button (on Floor):

enter image description here

But I would like the character to continue walking if the player clicked the right mouse button and held.

Like Set Destination (action mapping from Unreal).

Other places I searched:

https://www.youtube.com/watch?v=AIPPXGFkjF0

https://answers.unrealengine.com/questions/134746/hold-button-for-few-sec-and-play-event.html

It's a simple problem, but I can't find anything about. Not exactly. The problems I found in my search are not the same as my problem. Even changing the words and terms I was not successful.

\$\endgroup\$

1 Answer 1

0
\$\begingroup\$

With the help of the answer to this question:

https://answers.unrealengine.com/questions/438398/a-simple-question-about-click-press-hold.html

I discovered to solve my problem.

  • Add a boolean variable

  • Set it to true every time the mouse button is pressed

  • Set it to false every time the mouse button is released

  • Insert a While Loop that only ends when the boolean variable is false.

Code:

enter image description here

\$\endgroup\$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .