Allow multi touch

Hey, I made a touch input for my game’s character that is when the touch drags the camera moves but when I use the joysticks to move I cannot move the camera at the same time, but when I do the same code with blueprints the code works and the camera still moves when I drag the touch while pressing the joystick to move, I think that there is a problem in the ETouchIndex::Type because in the bp when I use the finger index given in the Touch event it works but when I only use touch 1 as the finger index it does not work, I think if I will put that index in my cpp code it will work too, but where can I find the finger index? can anyone please help me?

//here's my touch code that executes every tick.
	FVector2D TouchLocation;
	APlayerController* ActivePlayerController = UGameplayStatics::GetPlayerController(this, 0);
	ActivePlayerController->GetInputTouchState(TouchType, TouchLocation.X, TouchLocation.Y, IsTouched);
	if (!IsTouched)
	{
		DidOnce = false;
	}
	if (IsTouchMoved())
	{
		if (!DidOnce)
		{
			ActivePlayerController->GetInputTouchState(TouchType, PrevX, PrevY, IsTouched);
			DidOnce = true;
		}
		ActivePlayerController->GetInputTouchState(TouchType, X, Y, IsTouched);
		float FinalRotYaw = (X - PrevX) * UGameplayStatics::GetWorldDeltaSeconds(this) * 20;
		float FinalRotPitch = (Y - PrevY) * UGameplayStatics::GetWorldDeltaSeconds(this) * 20;
		AddControllerYawInput(FinalRotYaw);
		AddControllerPitchInput(FinalRotPitch);
		ActivePlayerController->GetInputTouchState(TouchType, PrevX, PrevY, IsTouched);
	}

This is the video of the problem I am facing-
https://drive.google.com/file/d/18bbx1xwYy69PSE1AMzxDydcqA91Pd0M6/view?usp=drivesdk

This topic was automatically closed 20 days after the last reply. New replies are no longer allowed.

Privacy & Terms