GetTimerManager() "No members available" but it works! IntelliSense bug?

Hey!
So, this is bothering me a lot.

I spent an awful amount of time trying to set up a timer, but IntelliSense kept telling me there were no members available, as seen here: https://i.imgur.com/s8gbrUE.png
I thought I was missing some header, or maybe it wouldn’t work just like that because I was using it on a ACharacter class, after an hour I just compiled out of frustration and it worked!

And I can’t help but wonder why that happened. Shouldn’t I trust IntelliSense? Or am I truly missing something?

I’d appreciate any answers with tips on this issue, and how to avoid it hopefully!
Thank you!

(My headers, just in case)

Header file




#pragma once
#include "GameFramework/Actor.h"
#include "CoreMinimal.h"
#include "GameFramework/Character.h"
#include "DGProjectCharacter.generated.h"

class UMaterial;



CPP



#include "DGProjectCharacter.h"
#include "UObject/ConstructorHelpers.h"
#include "Camera/CameraComponent.h"
#include "Components/DecalComponent.h"
#include "Components/CapsuleComponent.h"
#include "GameFramework/CharacterMovementComponent.h"
#include "GameFramework/PlayerController.h"
#include "GameFramework/SpringArmComponent.h"
#include "HeadMountedDisplayFunctionLibrary.h"
#include "Materials/Material.h"
#include "Engine/World.h"



Try including:


#include "TimerManager.h"

If it was missing an include I don’t think it would compile and complain about unknown types? Don’t quote me on that :wink:

Intellisense is ■■■■, get visual assist i can’t see how anyone gets anything done in C++ without it, AddDynamic never seems to show up for me but most other things do.

Or there’s resharpen or something similiar, never tried that myself though.

When this case first appeared to me, I also thought the same. I made a note to check why this happens, but time went by.
Nevertheless, without the include it compiles ok but no intellisense. With the include, the intellisense begins to work.

If it complies without it would that suggest its’ already included in Character somewhere further up? In pawn or Actor? I really should just open visual studio and have a look but my computer is to far away to be bothered. Next time I boot it up I’ll have a check :slight_smile:

C++ is a harsh mistress sometimes :slight_smile:

GetTimerManager() is an Actor function, but ACharacter inheretis from Pawn which inherits from Actor, so it should recognize it.
It was a long time since I took proper C++ classes so maybe I’m missing something?

^^^ This actually worked! As seen here: https://i.imgur.com/hq1gKZb.pngThank you!

And you called it indeed, it may compile but intellisense won’t work unless you include the header.

So, in conclusion I’d say to check on the class hierarchy, if the function you’re trying to access is inhereted by your class, then it will compile but intellisense may not get it right, so check for the correct header and you should be fine, or don’t, it will work either way.

Thanks everyone for helping, mystery solved!

Actually I’d like to ask you: How did you find that include? What I normally do is look up the function on the UE4 c++ docs, for example, this is the GetTimerManager() doc.But in this case, it’s not useful at all.

From:


[FTimerManager](https://docs.unrealengine.com/en-US/API/Runtime/Engine/FTimerManager/index.html) & GetTimerManager() const

Since FTimerManager is defined in TimerManager.h, I tried and it worked.