Announcement

Collapse
No announcement yet.

Mouse Movement not recognized

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

  • replied
    Hi Dune, the function works now. It had indeed to do with my Mapping AxisName. I had a typo there. There is now another issue: It doesn't work if I don't hold the left/right mousebutton. Unfortunately when I keep the left or right mouse button pressed, then the movement will get triggered.

    Any ideas?

    Leave a comment:


  • replied
    In your DeaultInput file (C:\Users\username\Documents\Unreal Projects\GameTest\Config), you should have some lines that resembles something like:

    -AxisConfig=(AxisKeyName="MouseY",AxisProperties=(DeadZone=0.f,Exponent=1.f,Sensitivity=0.07f))

    +AxisMappings=(AxisName="DoRotationY",Key=MouseY,Scale=1.000000)

    This will make sure your mouse is setup as an axis and then your DoRotationY will be picked up correctly by your SetupInputComponent. Also, is this on a character class and is the SetupInputComponent being overridden in the header?

    Leave a comment:


  • replied
    Yes, the two methods get called repeatedly. But only with a Value of 0.0f. Thus if I set a breakpoint within the if statement, it will never get triggered.

    Leave a comment:


  • replied
    Did you try to debug those value, see if it's even passing in your functions ?

    you can see how to print / log here : https://wiki.unrealengine.com/Logs,_...During_Runtime

    Leave a comment:


  • started a topic Mouse Movement not recognized

    Mouse Movement not recognized

    Hello Everyone,

    I am having some trouble getting Mouse Input working. I started with the Top Down Template and wanted to play around with camera movement a bit. First I added this to my PlayerController::SetupInputComponent:

    PHP Code:
    InputComponent->BindAxis("DoRotationX"this, &AMyProjectPlayerController::RotateCameraX);
    InputComponent->BindAxis("DoRotationY"this, &AMyProjectPlayerController::RotateCameraY); 
    Then I addded my two methods:

    PHP Code:
    void AMyProjectPlayerController::RotateCameraX(float Value)
    {

    }


    void AMyProjectPlayerController::RotateCameraY(float Value)
    {
        
    AMyProjectCharacterPlayer Cast<AMyProjectCharacter>(GetPawn());
        if (
    Player && Value != 0.0f)
        {
            
    USpringArmComponent *Arm Player->CameraBoom;
            
    FRotator Rot(0.0fValue GetWorld()->GetDeltaSeconds(), 0.0f);
            
    Arm->AddRelativeRotation(Rot);
        }

    The third step was to add the input in the editor. So I did this and added a Axis Input. One with Mouse Y and one with Mouse X.

    Now when I run the Game, and I set a breakpoint in the function RotateCameraY, i NEVER get a value for Value > 0.0f. Its always 0.0f. Doesn't matter how fast I move the mouse. Is there anything blocking my input ?

    Any help is very appreciated.

    Gr.
    Markus
Working...
X