Announcement

Collapse
No announcement yet.

Need help with RTS camera speed problem

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • replied
    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.

    Leave a comment:


  • replied
    Originally posted by NotSoAccurateNo1 View Post
    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

    Leave a comment:


  • replied
    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.

    Leave a comment:


  • started a topic Need help with RTS camera speed problem

    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:
    Click image for larger version

Name:	Blueprint.PNG
Views:	43
Size:	252.0 KB
ID:	1548843
    This blueprint then proceeds to this function:
    Click image for larger version

Name:	Function.PNG
Views:	13
Size:	201.3 KB
ID:	1548844
    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:
    Click image for larger version

Name:	Horizontal.jpg
Views:	11
Size:	104.2 KB
ID:	1548845 And in case of triggering the Mouse Y event, every two out of three ticks seem to be skipped:
    Click image for larger version

Name:	Vertical.jpg
Views:	10
Size:	118.0 KB
ID:	1548846Which results in the speed of vertical scrolling being half of that of horizontal.

    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
Working...
X