I want to create a character that walks infinitly to right(without any destination, say along +yDirection) WHEN I CLICK ON IT.

I want to create a character that walks infinitly to right(without any destination, say along +yDirection) WHEN I CLICK ON IT. I do not know where to start, i think "Move To Location or Actor " does not work, what must i do? Need help. Thanks.

There are three parts here:

  1. walking
  2. aiming right
  3. when clicked

So, your character should NOT have any of the “inherit control rotation” type flags checked.
In Tick (in the character,) call Set Actor Rotation to the orientation you want.
In the On Actor Clicked callback, set a boolean flag IsWalking to true. In clicked-stopped callback, reset this flag.
In Tick, check if IsWalking is true, and if so, call AddMovementInput on the character movement component, with “forward” as the movement vector.

1 Like