I’ve been familiarizing myself with UE and it’s workings, and I’m running in to some issues which I’m having trouble wrapping my head around. I’ll start with what I’ve been doing for clarity and insight into the issue then have the issue at the bottom.
I wanted to build several different input interfaces and methods in an attempt to familiarize myself with the input components, scripting components, and blueprint components, and all that they attach to. While doing so, I decided to attempt to make an RTS style mouse control. This would include panning when the mouse would near the edge of the screen, using the mouse wheel to zoom in and out, creating selection boxes, issuing commands to pawns etc.
Initially I started off with creating a C++ PC class, and building a PC BP from it. Then I set up the mouse cursor in the PC by enabling show cursor, enable click events, and enable mouse over events. I created a C++ Pawn blueprint, in which I created the standard scene, spring arm, and camera, while adding a reference to the PC and using the mouse coordinates in the view port to make transformations to the viewport location. All this works fine.
The next step was to integrate zoom functionality, and this is where I ran into issues. I have created Axis mappings for zoom in the editor under project settings, which include WS(KB keys) and MW up/down. I referenced these inputs in my C++ class and created a function to run based off the Axis values (namely creating a zoom speed, multiplying the zoom speed by the axis value, checking it against a min zoom and max zoom conditional calculation, and then finally a transform in the spring arm target length.
Here are the issues.
1)When Play testing, if I click into the viewport (Which has a tooltip, click for mouse control), the cursor dissapears.
2)Unless I click into the viewport, the input’s for zoom do not register.
3)When clicking into the viewport to register the inputs, only WS(KB keys) register, and the mouse wheel does nothing.
How can I make the cursor uniform without having to click into the viewport? Why aren’t the mouse wheel inputs registering? and Why do I need to click in to the viewport to enable input functionality, while not needing to do so using the PC Controller reference with GetMousePosition() for screen panning?