Hello all,
I want to preface this by saying that I am a beginner so the Blueprints you see are not the prettiest nor the most optimized.
I am trying to recreate WoW’s Camera System.
I have implemented the Left/Right/All Click.
Left moves Camera, Right Moves Camera and turns character and both together turn the Camera, Character and add forward velocity.
Just clicking should not activate the camera. The user has to click and move the cursor by a pixel to activate it. That’s the root of my problem but a necessary feature.
The Enhanced Input Actions have these props:
MouseMove is Vector 2D.
Left/Right is Boolean.
My detection works semi perfectly and changes the variables correctly.
I encountered a bug that if you double click fast enough or just rapidly click, the method to control the camera doesn’t catch and bugs out.
For example:
I want to enter the left mouse mode: I press and hold the mouse and move it by a pixel. This works and I am now in the left mouse mode.
If I instead click rapidly and still hold the mouse, it bugs out and doesn’t register anything.
If I continue to hold the left mouse button while in this bugged state and then hold the right mouse button, I enter the both mouse button mode.So it registers the left mouse click but doesn’t act on it and change the Enum and bIsDragging Boolean correctly.
I am sorry if this Example is hard to understand. English is not my first language and I am happy to help and explain it further in the comments.
I have attached my Classes below. I am a beginner so please do not get a Seizure.
I would really appreciate your help. Thank you in advance.
This sets the mode for the camera (Left,Right,Both) based on the input.
This is my detection for if the user is holding the mouse down and dragging it by a pixel.
This is the class where all the logic regarding the Modes will go.
Like left click only rotates the camera and right click the player and camera.
These are all of my Variables.
This is a short video further highlighting my issue.
It reaches the point it has to reach but doesnt apply the Code from the Switch.
I put a Print String at the End of the Function (Left Click). It reaches it but doesnt apply the logic before it (Hide Mouse Cursor)
To avoid confusion, these are the Prints on the left:
Active = Function is running
Stuck!!! = Left Mouse is Held but not dragging
Green Text = Left or Right Mouse Held (False/True)
Red Text = Is Dragging (False/True)
Blue Text = Enum Mode (None/Left/Right/Both)
Edit (yeah I know 500 edits but im tired and keep messing up):
- Updated Screenshots to match my current Blueprints.
- Added Video for further explanation.
- Spelling