The flying tank bug is a result of differential forces on the tank due to how we’re moving our tank. Currently, we apply Force to the track location which is at the bottom of the tank. Pushing the tank like this causes more force at the bottom than the top creating torque. While held to a level surface (by gravity in our case), the force applied to Z-axis is absorbed by surfaces (effectively limiting our force 2-Dimensionally). Once the tank is no longer level (has enough forward force and torque to overcome gravity), applied force affects the Z-axis lifting the tank (3-D force). You could see the effects of this you had double speed on the tank (Using Stick and Triggers together), the tank would start doing a wheelie. Attempting to turn (apply negative force on one track and positive force on the other) greatly increases torque. This can be handled the same way we solved sideways slippage, but vertically and only applying force negatively (effectively increasing gravity).
Thanks for this insight, Brian. Do you have a patchset or code snippet you can share which fixes this?
None that were effective and didn’t add more bugs
I wonder if we apply the forward force to the tank body (instead of the bottom of the tank tracks) whether that will fix this issue.
Or could we somehow apply the force to the top of the tank tracks instead of the bottom of the tank tracks?
For me, this game is unplayable with the flying tank bugs (for some reason it’s far worse in my game than it is in Ben’s videos) - quite disappointed to see the message at the top of this video that says “we never found a fix for this bug”.
Firstly my problem is massively exaggerated due to me being “clever” early on and creating an interesting landscape that had lots of undulations in it. If you have done this, go the landscape editor, use the flatten tool with flatten target set to 1.0, strength set to 1.0 and a nice big brush size. Flatten the big part of your area that is meant to be flat.
Secondly, rather than try to counteract the upward force by generating power at the bottom of the tank tracks, I am experimenting with applying the force to the tracks at a positive Z index location - i.e. attempting to push the tank from the middle of its mass rather than from the bottom its mass:
FVector ForceApplied = this->GetForwardVector() * this->CurrentThrottle * this->TrackMaxDrivingForce; FVector ForceLocation = this->GetComponentLocation() + FVector(0.f, 0.f, this->ForceZIndexOffset);
So far a value of ForceZIndexOffset of 60.0 (cm) appears to be about right where the tank is neither pulling wheelies or endows).
Note: this is not solving the damn terrain-starts-flying bug, but is helping a little bit by pushing the tank from the middle of it’s mass rather than from the bottom (similar to @Brian_Upsher 's suggestion).
This is extremely disappointing and very frustrating for me. I’ve been patiently waiting to actually play my game without having all the tanks flipping upside down.
Has anyone found a solution? The game is unplayable for me.
Has anyone changed their tank movement to use the C++ feature for vehicle movement? I’m considering trying that.
Near the end of the section you make a suspension system and apply thrust to the wheels. That should eliminate most if not all these issues.