Visual Studio Error List isn't any helpful

Hello everyone,

I am a professional Java developer but I am new with both C++ and Unreal Engine.

My problem is I am trying to write a code to detects all my Cameras in the level and cycles them.

So this is how far I came,

|

I am not sure with the second cast but it made the error about types go away. But I don’t know if I can cast ACameraActor* to AActor.

Whatever my question is in this state I can not compile my code but all errors shown at Error List are showing library classes which I didn’t wrote of course. Is this error list unhelpful or am I being too lazy to understand? I can’t figure out what the problem is in here.

Open the output panel ( View → output / Ctrl W → Ctrl O )

Error list in nor reliable, output log tell you what compiler say ( much better to fix errors )

in your case, as you said you want to find all cameras : i would suggest to use the actor iterator feature :

for (TActorIterator<ACameraActor> It(GetWorld()); It; ++It)
		{
			ACameraActor* camera = (*It);
		}

Also,you don’t have to cast to correct class when you try to compare 2 Actors ( or UObjects ) because you are comparing pointers, so it would be perfectly find to do

if(OurPlayerController.GetViewTarget() ==cameras[i])
{
// some code
}

Regarding the error list, I’ve noticed in Visual Studio Professional, this option:

Not sure if you find this in community or other versions?

This looks to me like it solves the problem with the error list, I am still in the process of testing.
If it does, I think Epic should review this documentation (Setting Up Visual Studio for Unreal Engine | Unreal Engine Documentation) that specifically mentions turning it off.

The error list is a more readable way to look at errors, warnings… etc

1 Like