I am making a Helicopter game and would like to have the ability to split up mouse input. Currently, mouse input is either MouseX or MouseY, they both can be between -1.0 and 1.0. I would like to be able to bind MouseY+ to Pitch Up and MouseY- to Pitch Down. That is currently not possible.
I want these input actions split up because I also want to support the idea of binding Pitch Up to say the UpArrowKey and Pitch Down to the DownArrowKey
I do not know if this at all possible and would appreciate any help.
Thanks!
by default the mouse movement_Direction is sent as an FVector2D. so if you are only getting one or the other then something else is going on. try checking your InputAction (it should be marked as Axis2D(Vector2D)) and the InputMappingContext has the input from Mouse XY 2D-Axis (negating the Y axis is up to you for your application)
then as an example of a bound C++ look function:
void AMyCharacter::Look(const FInputActionValue& Value)
{
// input is a Vector2D
FVector2D LookAxisVector = Value.Get<FVector2D>();
GEngine->AddOnScreenDebugMessage(INDEX_NONE, 1.0f, FColor::Green, LookAxisVector.ToString(), true);
if (Controller != nullptr)
{
// add yaw and pitch input to controller
AddControllerYawInput(LookAxisVector.X);
AddControllerPitchInput(LookAxisVector.Y);
}
}
just putting the GEngine->AddOnScreenDebugMessage() should show that you are getting both X and Y components.
for the purpose of having keyboard keys, or say a d-pad also bound to the input action that would be done in the InputMappingContext as well
what you do with the data after you receive it is up to you.