Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Correction for simulated movement with enhanced input in public/0.12.x-UE5.1 #74

Open
lynconEBB opened this issue Nov 9, 2023 · 0 comments

Comments

@lynconEBB
Copy link

I encountered some frustration with the camera and hands movement while using the simulated features. Upon delving into the code, I discovered that the AXRSimulationActor's Input actions were utilizing UInputTriggerDown triggers. These triggers processed input only when passing a 0.5 threshold, which proved less than ideal for achieving precise movement.

To address this, I propose a modification: refrain from adding the UInputTriggerDown trigger when creating the Input actions in the XRSimulationActor.cpp file. This adjustment ensures a smoother and more accurate user experience.

File: XRSimulationActor.cpp

void AXRSimulationActor::RegisterEnhancedInputAxis(UInputAction*& Action, FText Description, TArray<FKey> Keys, bool Negate)
{
	Action = NewObject<UInputAction>();
	Action->AddToRoot();

	Action->ActionDescription = Description;
	// Remove this line
        // Action->Triggers.Add(NewObject<UInputTriggerDown>());
	Action->bConsumeInput = false;
	Action->ValueType = EInputActionValueType::Axis1D;

	if (Negate)
	{
		Action->Modifiers.Add(NewObject<UInputModifierNegate>());
	}

	for (FKey Key : Keys)
	{
		InputMappingContext->MapKey(Action, Key);
	}
}

void AXRSimulationActor::RegisterEnhancedInputAction(UInputAction*& Action, FText Description, TArray<FKey> Keys)
{
	Action = NewObject<UInputAction>();
	Action->AddToRoot();

	Action->ActionDescription = Description;
	// Remove this line
        // Action->Triggers.Add(NewObject<UInputTriggerDown>());
	Action->bConsumeInput = false;

	for (FKey Key : Keys)
	{
		InputMappingContext->MapKey(Action, Key);
	}
}
Olli1080 added a commit to Olli1080/MixedReality-UXTools-Unreal that referenced this issue Jan 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant