1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.
  2. Two Factor Authentication is now available on BeyondUnreal Forums. To configure it, visit your Profile and look for the "Two Step Verification" option on the left side. We can send codes via email (may be slower) or you can set up any TOTP Authenticator app on your phone (Authy, Google Authenticator, etc) to deliver codes. It is highly recommended that you configure this to keep your account safe.

Detecting Mouse Movement?

Discussion in 'Programming' started by Dark[NSF], Jul 17, 2003.

  1. Dark[NSF]

    Dark[NSF] Northwest Secessionalist Forces

    Joined:
    Mar 12, 2003
    Messages:
    632
    Likes Received:
    0
    How do you do this?

    Maybe somehow by using these?
    // - PlayerController Input float vars:
    aBaseX, aBaseY, aBaseZ, aMouseX, aMouseY, aForward, aTurn, aStrafe, aUp, aLookUp

    Thanks for the help.
     
  2. (v)adOnion

    (v)adOnion chroot /

    Joined:
    Feb 19, 2002
    Messages:
    44
    Likes Received:
    0
    Where are you trying to detect mousemovement? In menus or while controlling a pawn?
     
  3. Dark[NSF]

    Dark[NSF] Northwest Secessionalist Forces

    Joined:
    Mar 12, 2003
    Messages:
    632
    Likes Received:
    0
    Controlling a Pawn.
     
  4. Shrimp

    Shrimp Seafood splatter

    Joined:
    Jan 13, 2003
    Messages:
    740
    Likes Received:
    0
    I know aTurn tracks horizontal movement of the mouse, aTurn < 0 = turning left, aTurn > 0 = turning right.

    Never needed vertical moust tracking, but I suspect it's either aUp or aLookUp...
     
  5. Dark[NSF]

    Dark[NSF] Northwest Secessionalist Forces

    Joined:
    Mar 12, 2003
    Messages:
    632
    Likes Received:
    0
    if ((PlayerController(Instigator.Controller).aTurn < 0) || (PlayerController(Instigator.Controller).aTurn > 0))
    {
    ClientMessage("Stop moving fool!");
    }

    When I move the mouse nothing happens, did I do something wrong?
     
  6. (v)adOnion

    (v)adOnion chroot /

    Joined:
    Feb 19, 2002
    Messages:
    44
    Likes Received:
    0
    From the way you wrote it you are accessing it from another class. Iirc that never works because you are handling input flags and they are reset after usage (not 100% on this one tho)

    Handling your check directly in function UpdateRotation(float DeltaTime, float maxPitch) will work however. And check for "if (aTurn != 0)" ;)
     
  7. Dark[NSF]

    Dark[NSF] Northwest Secessionalist Forces

    Joined:
    Mar 12, 2003
    Messages:
    632
    Likes Received:
    0
    That function can be placed in WeaponFire?
     
  8. (v)adOnion

    (v)adOnion chroot /

    Joined:
    Feb 19, 2002
    Messages:
    44
    Likes Received:
    0
    No .. it is contained in the Controllerclass. You could however overwrite the controllerclass and have UpdateRotation store the value in the corresponding pawn for example. WeaponFire could then access it ... however the next time updaterotation is called this movement value is gone again unless you add code to counter this (maybe with a timecheck to see if the pawn turned within the last second?)

    The problem you are running into is updaterotation being called frequently. When it is called and you are not turning in the instant your are checking but instead the tick before your rotation check will give you a "no rotation in progress".
     
    Last edited: Jul 18, 2003
  9. Dark[NSF]

    Dark[NSF] Northwest Secessionalist Forces

    Joined:
    Mar 12, 2003
    Messages:
    632
    Likes Received:
    0
    lol, I can't put it anywhere; the compiler simply says

    "Enexpected Function"

    I've placed it 3 different places.. Strangely enough nothing changes...
     

Share This Page