Warning in Tank_BP

Hi I got wierd warning on Tank BP after compiling… but it does work…

.

Thanks for help

Well, look at what it’s telling you. As Tank_BP is a child of ATank, the method should be protected, not private.

I’m surprised it’s actually working, however. Might be a caveat of the UFUNCTION macro.

Well… its in protected not in private… i have done as in video was show…

That’s the movement component itself, not the IntendMoveForward function. I’d check to make sure that’s protected, as there’s nothing else in your protected section there.

I actually misunderstood the question somewhat, I thought the function was on ATank. Since you’re calling the IntendMoveForward function from the Tank_BP and not from an object of class UTankMovementComponent, the function must be public.

i think i am calling it from TankMovementComponent… the definition is in TankMovementComponent.h and TankMovementComponent.cpp…

Yeah, you are. I forgot the architecture that was being used earlier on, and the function should be defined in your UTankMovementComponent. The function should be public, so it can be called from another class, in this instance the Tank_BP.

I’m going to go off on a limb and say the C++ to Blueprint system allows you to call the function where you shouldn’t be able to, although it does give you a warning.

Privacy & Terms