Two Beginner Questions - Third Person Camera Rotation - Multiple Mouse Events

I’m making a third person game and want my camera to follow my mouse, but not only that, i want my character to look and turn wherever my mouse goes. Example: Tera. So I want it to have the same logic as a first person, but in third person mode. Can any one help me with that?

Second question is multiple events. Let’s say I want to make an event where if i tap W twice my character does a dash. That’s simple. I did that. But what if I left click in addition to double tapping w? I want it to perform a different attack instead. But I can’t figure out how to say “if W has been pressed twice and left click has also been pressed, then do this”.

Thanks in advance.

Hello,

As for your first question, the answer is here: How to allow a 3rd person character to face where the mouse is aiming - Blueprint - Epic Developer Community Forums
As for your second question, just left click on your blueprint, make a branch, left click again and make a “and boolean” node. Then connect the first boolean wire of “double tapping of w” AND “the other thing you want to do” and on the return wire of this boolean, connect it to a branch.

Ok this is what i’ve done so far on my second question. This picture shows the custom event of “dash attack” that i made.

This picture shows what I used to “call” the function. It works, but i’m sure there’s a better way to do this?

Here’s an update. I got it working better now. However, I want to add W, A, S, and D, not just W. So I tried adding the A and using the same logic from the W. It works but the problem is now when i press A and then W or vice versa in succession, it will register that as a “double tap” even though they are two different keys. So it should only dash when one key is double tapped. Not a mixture of any key. How can i fix this?

Hi :slight_smile:

I’m not exactly an expert here - but from what I can see I must assume you’re using the same variable for your W and A logic. You’ll have to have a separate “# presses” variable for each key. Alternatively, reduce the delay on your set #presses to 0, although that would probably affect your gameplay.

Multiple variables should be the way to go :slight_smile:

Hi Ziven,

That’s happening because you are determining the “double tap” event based off of a single variable (#Presses). Since “W” and “A” are using the same exact code, you will need to determine a way to distinguish which key has been pressed and set the #Presses for that key.

thank you! i had already fixed it and forgot to update. was silly of me to overlook that. i got everything working now.

No problem. Any advice for future people checking out this thread on how you solved your issue?

Yes, as the others said, i was using only one variable for “keypresses”. To solve this, you just use a keypresses variable for each individual key. i also seperated each key. so i have a W state, A state, S state and so on.