** Update: It turns out, this is only occuring when Playing the level directly from the editor. If I start by playing the MainMenu, suddenly I can steer.
I’ve wired the Gamepad trigger and shoulders to the right and left tracks, and each is receiving the input and applying force to the tank.
When the tank moves, regardless of which track is set, it moves only forward and backward, and will under no circumstances actually turn. I’ve tried applying the force to the tank, as well as to the track itself (no difference between movement). I’ve tried logging the ForceApplied and ForceLocation and they are applied at two different spots. No turn. If you apply the right bumper and the left trigger, you get… full stop…
void UTankTrack::SetThrottle(float Speed)
{
float Throttle = FMath::Clamp(Speed, -1.0f, 1.0f);
//UE_LOG(LogTemp, Warning, TEXT("Setting Throttle to %f"), Speed)
FVector ForceApplied = GetForwardVector()*Speed * TrackMaxDravingForce;
FVector ForceLocation = GetComponentLocation();
UE_LOG(LogTemp, Warning, TEXT("%s SetThrottle %s - %s"),*GetName(),*ForceApplied.ToString(),
*ForceLocation.ToString());
auto TankRoot = Cast<UPrimitiveComponent>(GetOwner()->GetRootComponent());
TankRoot->AddForceAtLocation(ForceApplied,ForceLocation);
}
Log with one throttle applied:
LogTemp:Warning: RightTrack SetThrottle X=14308772.000 Y=13973513.000 Z=-2588.597 - X=10106.510 Y=-19524.641 Z=101.159
LogTemp:Warning: Left Track SetThrottle X=0.000 Y=0.000 Z=-0.000 - X=10309.869 Y=-19730.016 Z=101.162
Log with one trigger and one shoulder:
LogTemp:Warning: RightTrack SetThrottle X=-7842692.000 Y=-18398154.000 Z=-801.077 - X=17879.813 Y=-16876.969 Z=101.180
LogTemp:Warning: Left Track SetThrottle X=7842692.000 Y=18398154.000 Z=801.077 - X=18146.465 Y=-16988.461 Z=101.136
The current commit on my Git. Tank will not turn.