Download

Issue with identifier

Hey I’m having issues with an identifier not being defined…

This is in the header file…

This is the source file, the issue is with the CollectionSphere identifier, now I thought it could be something I didn’t include but I don’t know.

Did you include:


#include "Components/SphereComponent.h"

What is the error message?

It’s saying the variable is “undeclared,” I’m going to scrap the script and start over. How exactly do I import a prewritten script into VS?

You are confusing 2 different parts of code.

You need to declare in your .h file
USphereComponent CollectionSphere;*

The FORCEINLINE is totally separate, it is a public function call so that other actors or objects that have reference to that class/actor can directly call those 3 functions as get functions to get the camera/boom/collectionsphere object;

That first part of the code is in the header file. Ok so FORCEINLINE should be replaced with what?

If the error is that specific line in the .h file then its either is complaining about the class USphereComponent or its complaining about CollectionSphere.

comment the line that wont compile out if you don’t need it right now and see if it compiles.

But you are either missing a include header/forward delcation for USphereComponent or you dont have CollectionSphere declared in the same .h file.

Posting the actual compile error message would help.

Or the entire .h file as well.

In the .h file is the *USphereComponent CollectionSphere; **declaration above or below the FORCEINLINE statement?