2016-RCAD-GA-Thesis / terminal

0 stars 0 forks source link

Driving issue #13

Open rhuberga opened 9 years ago

rhuberga commented 9 years ago

When attempting to spin sideways* around the tubes, the car loses momentum near the sides. I remember very clearly that this was not an issue earlier. I could spin at full speed with no problems. Currently no idea what the cause is.

*clarification, left / right slide inputs, not yaw turning.

rhuberga commented 9 years ago

Broke a few parts of the vehicle code trying to find the cause. Haven't found anything yet. Started a brand new level with nothing but one tube, had same problems. There's also a bit of stutter when flying, I think that some variable is being redundantly written, but I can't figure out which one.

rhuberga commented 9 years ago

Added a quick fix that dots the car up against world up so that, at the very least, the controls won't be reversed on the underside of the track. Still troubleshooting. (have added another DOT solution for all 3 orientations. works but doesn't feel good, should still attempt below solutions when time permits)

rhuberga commented 9 years ago

Fixed. Tweaking numbers then this will be resolved! Causes unexpected roll while flying. Also causes speed loss while going up slopes. No idea why, have not started troubleshooting this yet.

rhuberga commented 9 years ago

Regarding rotation issues: Character input doesn't rotate with the movement component; basically you have to tell the Character how to react to left-right and up-down input with blueprints or C++ code.

This is what I used in my Character class (sorry, C++ code):

void AExCharacter::SetupPlayerInputComponent(class UInputComponent* InputComponent) { // Set up gameplay key bindings. InputComponent->BindAxis("MoveForward", this, &AExCharacter::MoveForward); InputComponent->BindAxis("MoveRight", this, &AExCharacter::MoveRight); }

void AExCharacter::MoveForward(float Value) { if (Controller != NULL && Value != 0.0f) { // Add forward movement. AddMovementInput(FVector::VectorPlaneProject(FRotationMatrix(Controller->GetControlRotation()).GetScaledAxis(EAxis::X), GetCapsuleComponent()->GetComponentQuat().GetAxisZ()).GetSafeNormal(), Value); } }

void AExCharacter::MoveRight(float Value) { if (Controller != NULL && Value != 0.0f) { const FVector CapsuleUp = GetCapsuleComponent()->GetComponentQuat().GetAxisZ();

    // Add side movement.
    AddMovementInput(CapsuleUp ^ FVector::VectorPlaneProject(FRotationMatrix(Controller->GetControlRotation()).GetScaledAxis(EAxis::X), CapsuleUp).GetSafeNormal(), Value);
}

}

rhuberga commented 8 years ago

If I can't fix it with this, I may be able to move everything into 4.9 and use this plugin: https://forums.unrealengine.com/showthread.php?85022-Blueprint-C-Advanced-Templates-Tools-amp-Plugins https://github.com/mhousse1247/UE4-CustomGravityPlugin/tree/master/Plugins/CustomGravityPlugin

This would also fix #12