Hi, i want to implement rotation of the character when i press and hold RMB, so otherwise he will face to where he walking to (like in Signalis, if you are familiar)
The trouble is - i am skill issue, i am able to do it in C++, but since i got from unity to unreal - i wan’t to learn the blueprint as it seems to be way more interesting
Not familiar with the game you mentioned, but it looks like it has the character look at the mouse location when aiming, but runs towards directional presses otherwise. Is that about right?
If so, you’ll probably want the character to have UseController’sDesiredDirection and OrientRotationToMovement set to true in the movement component. Then in the player controller class, have the “triggered” pin of an enhanced input action for right mouse call a function to set the controller’s rotation as in your screenshot. With character set to use controller’s rotation, it should rotate smoothly. May need to tweak the character’s rotation rate though.
The started pin there should set the aforementioned OrientRotationToMovement option to false since that overrides control rotation.
Then to get the char walking in the direction of movement keys again, from the “completed” and “cancelled” pins of that input action set OrientRotationToMovement back to true in the character’s movement component.
I did so, and as it seems - there is something with rotation triggering itself, that i don’t understand, because if i remove connection from “every tick” in either controller or character blueprint - it won’t react on any control input.
I had thoughts that it works on constantly rotating every tick and input triggers it only once, enough to be unnoticed by eye, so i tried to find some logic gates like AND, but couldn’t find none
Yea. If you’re using the enhanced input system, the Triggered pin on the input action should fire basically on tick. Well, technically, I guess the frequency is determined by the hardware polling rate, but should be fast enough. This is how they have the clicky movement setup in the topdown project template.
If using raw mouse events or the deprecated action bindings, on mouse clicked/pressed/released, you could simply set a bool which you check with a branch in the tick event.
i’ve had to redo the whole looking & movement system from scratch (which broken whole thing couple times) but yeah, the key was to make IA for mouse with designated RMB, which by itself on Triggered pin will tick as Event Tick