Skip to content
This repository was archived by the owner on Feb 1, 2025. It is now read-only.

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

@lynconEBB

Description

@lynconEBB

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);
	}
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions