Download

An official tutorial is not working for me..

Hello Friends… i successfully done the first C++ tutorial where i needed to créate an actor via c++, (i´m happy)

Now, i followed up with the next one:

https://docs.unrealengine.com/en-US/…als/AutoCamera

I follow every step, no errors, but at play time, nothing happens, there is no movement at all, all is quiet… Something i have seen on tutorial is that was tested on 4.9 , but i have installed 4.21.2

Is it working on lastest?

Thanks.

It should work fine in 4.21. Have you added an instance of the CameraDirector to the level and linked the references of camera one and camera two to different cameras?

Yes, I did all that, but still nothing happens.

I have noticed that start view is not from any of those two cameras, is edition view, is like none of those camera where selected to be default… :rolleyes:

Is strange, I have tried a debug message but even this is not showing on the screen…



#if UE_BUILD_DEBUG
 GEngine->AddOnScreenDebugMessage(-1, 3.0f, FColor::green, "Mensaje");
#endif


Is like if all the actor code is being missed…

You don’t need to wrap the line in UE_BUILD_DEBUG and you are probably using UE_BUILD_DEVELOPMENT so it will never run.

if i put UE_BUILD_DEVELOPMENT or i remove the preprocessor condition, then VS displays GEngine is not defined…

Have you remembered to include


#include "Engine/Engine.h"

Thanks, i Will try again…

Just curiosity, why with UE_BUILD_DEBUG I don´t needed to have Engine.h header ?..

Because if you’re building a Development build it will not try to compile stuff that you specifically wrapped in Debug build. That is one of the benefits of build configurations. It lets you setup different builds with different features included. If you did a Debug build the error would show.

Thanks … good to know that…

Getting back to my problem, this is how i have:

As you can see, both cameras are attached but when i hit play, nothing happens…
Scripts is the same of the tutorial (both .h and .cpp)

And Debug is working…!

Is everything in the Tick function being executed? what if you place the AddOnScreenDebugMessage to the innermost part of the Tick function?

If your Unreal Engine installation has “Engine source” and “Editor symbols for debugging” then you can attach the Visual Studio Debugger and add a break-point in the function to easier spot what is wrong.

bCanEverTick was false… i remember now chaged it to test and forgot to set it to true…

I have noticed that after changing to true and compiling, needed to delete current actor from scene and put it again… is this fine ?..

Thanks for your help…

Programming == patience :slight_smile: You’re welcome.