Track not ticking

I have an isue : my tracks are not ticking.

My code was a little different from the Ben’s one, but I end by replacing all mine by the one in the repo, and still dont works.

I set a beginplay, and was runing well, but still no tick

now, the fun part

if I add

RegisterComponent();

in the Track constructor, then the tank start to spin, seems to hang , and then … it ticks … and crash

I clean the project, recompile, still the same. Moving RegisterComponent to Begin play have no effect.

Any idea to help me to fix this little bug ?

here is my repo adress : https://github.com/ereyre/zzBattleTank.git

I give up to fix this I spent to much time on it, I have found a way to fix this : I have enabled Tick on the UTankMovementComponent, and in this tick methode, I’m calling a public CustomTick method for both tracks.

In repo you can find it with tag AwfullFix :slight_smile:

Maybe I should open a ticket, I’ll look at this later, and maybe I’ll find the solution.

Because you aren’t overriding the TickComponent function. What you need “TickComponent” and “override” as follows:

virtual void TickComponent(float DeltaTime, enum ELevelTick TickType, FActorComponentTickFunction *ThisTickFunction) override;

What you have

void CustomTick (float DeltaTime, enum ELevelTick TickType, FActorComponentTickFunction *ThisTickFunction) ;

Thank Dan for the answer, but that’s my solution : the TankMovementComponent Tick and call my custom Tick methode. I Don’t call it TickComponent just in case it may start to work (and then be called twice). If you look at my previous comit :

I have the same TickComponent declaration, and if i call RegisterComponent() it start to work ( but all tanks are spining in the air then hang and crash)

I fact, I try an another PC with the same result, and Ben’s version is working well in his project, but if I copy his code in my project, it won’t work. I check the blueprint setup, and don’t find any major diference.

Anyway, my solution is working, probably not the best one, but it works.

Ok so I’ve narrowed it down and I think there’s something different with your Tank blueprint as I haphazardly changed your blueprint with Ben’s and it’s working just fine. Just don’t see what the difference is yet.

Edit: Forgot to reset to your previous commit so that might not be true, will look into it later.

Edit2: Resetting to that commit and applying Ben’s blueprint (with your C++ code) still works. So I’m pretty sure there’s something different with yours but I can’t find anything different.

#Solved

Wish I did this first before spending hours trying to find differences between the two projects, in the code, blueprints and static meshes, deleting intermediate and binaries and recompiling… But doing the number 1 tech support answer “turn it off and on again” worked.

No idea why it worked but I deleted your tracks and re-added them and it works fine now.

2 Likes

Yes, confirmed !!! good to know that I never try this one, but I definitivly have to begin with this "methode’

anyway, many thanks for your help

Confirm this, Unreal 4.19: The only way to get the TankTracks ticking was to put in the code as described and then to delete them and add them again.

1 Like

Privacy & Terms