Need help with RTS camera speed problem

Hi,

I’ve created a blueprint logic to control RTS style camera. Almost everything works except one annoying thing - when I trigger a function to scroll my view across the map using Mouse X and Y events, both of the events seem to repeat at a different rate, resulting in vertical view scroll speed being half of what horizontal speed is. What is more curious is that it doesn’t happen when I trigger the same function using WASD keys.

This is what my blueprint to trigger view scrolling using cursor proximity to screen edge looks like:


This blueprint then proceeds to this function:

It may look slightly messy due to the noodlework required to limit the camera pawn going out of the bounds of map, but other than that it’s pretty simple. Basically, things outside the function will set the values of View Move X and Y variables, and then call this function, which uses values supplied by those variables to move the camera pawn.

In case of WASD keys it works, but in case of Mouse input on the first picture, when triggering horizontal scroll using Mouse X event, every third tick seems to be skipped as seen on the print string:

And in case of triggering the Mouse Y event, every two out of three ticks seem to be skipped:
Which results in the speed of vertical scrolling being half of that of horizontal. :frowning:

Does any blueprint expert know what could cause this and what the possible solutions or workarounds are? I fail to see any reason it should behave this way, but I am sure I am missing something.

Thank you in advance :slight_smile:

I don’t really see anything wrong either. So my next gander is that I’ve had issues in the past with dropped numbers (particularly after I’ve closed and relaunched the editor, but it was also specifically splitting the pin of a stored vector variable node) whenever I use a “split” operation on the pins. So just recombine the pins, and use a Break or Make node instead, and relaunch the editor.

Actually, I’ve probably found the culprit. Input events are basically synonymum for frame tick, and apparently I am setting the variable multiple times each tick on different places. My idiocy never ceases to amaze me :slight_smile:

I figured the screen was moving whenever your mouse left the center of the screen, but I thought that was intended. My bad. Glad you got it working though.