So.. has anyone figured why force isn't applied to the wheels?

The code is verbatim, I’ve checked and triple-checked. Even so, I’m sure there’s some setting that isn’t identical since the tank doesn’t seem to get any force applied. I’m curious about this function in the SprungWheel.cpp

void ASprungWheel::AddDrivingForce(float ForceMagnitude)

{
Wheel->AddForce(Axle->GetForwardVector() * ForceMagnitude);
}

Where does ForceMagditude get any input? I mean, it’s not an exposed UPROPERTY or initialised as a float with any value. Also, has anyone figured out a way to move those wheels? I could make a workaround and add force through blueprint, but I feel that would be too much of a cheat.

I’ve went back a few videos, recreated the SprungWheel_BP and made sure every setting is identical. Unfortunately, force isn’t applied to the wheels, they just stand there… all this course has been like this.

I have found out that DriveTrack function isn’t doing anything. I’ve put some logs and none are being called. What could the problem be?

Annotation 2021-02-03 132712

Throttle is the CurrentThrottle called in UTankTrack::SetThrottle, being called only on the spring test level. On the battleground level it just spikes bettween random values. And the ForcePerWheel is the ForceApplied (I didn’t change the name in the log) from the DriveTrack(). It’s weird how on some levels it works and on some it doesn’t. I got these result after deleting everything and rebuilding the whole game.

This one is force per wheel. What is this?

Annotation 2021-02-03 133536
If I press any input, it goes from -nan to inf or -inf which I asume it stands for infinite? What?!

I found the problem. It’s the for loop. It doesn’t work at all.

I would assume that means GetWheels is returning an empty array.

I’ve reversed my commit and gave up for now. I’ll come back after I finish the whole course

Privacy & Terms