So I’m admittedly doing my FIRST tutorial through this youtube link here:
I do have 9 years of programming background, before flash died I worked at companies making social games with it. So very comfortable with OOP concepts. Php/Mysql,Javascript. I’ve successfully built hello world C++ starter program all the way up to c++ SDL compile that worked on windows/mac/linux. So I’m a c++ beginner, but not a beginner to programming.
that being said I’m stumped on how in that tutorial he writes this line of code that compiles, and it wont for me… here’s the exact time link:
my function (I even commented out the code afterwards to try to solve this compile error)
FHitResult AFPSCharacter::InstantShot()
{
FVector rayLocation;
FRotator rayRotation;
FVector endTrace = FVector::ZeroVector;
APlayerController* const playerController = GetWorld()->GetFirstPlayerController();
if (playerController)
{
playerController->GetPlayerViewPoint(rayLocation, rayRotation);
endTrace = rayLocation + (rayRotation.Vector() * weaponRange);
}
FCollisionQueryParams traceParams(SCENE_QUERY_STAT(InstantShot), true, Instigator);
//FHitResult hit(ForceInit);
//GetWorld()->LineTraceSingleByChannel(hit, rayLocation, endTrace, ECC_Visibility, traceParams);
return FHitResult();
//return hit;
}
My error shows up as:
Severity Code Description Project File Line Suppression State
Error (active) E0265 member "AActor::Instigator" (declared at line 643 of "C:\Program Files\Epic Games\UE_4.25\Engine\Source\Runtime\Engine\Classes\GameFramework\Actor.h") is inaccessible BryanLearnV1 C:\Users\dev\Documents\Unreal Projects\BryanLearnV1\Source\BryanLearnV1\FPSCharacter.cpp 54
my includes on FPSCharacter.h
#include "CoreMinimal.h"
#include "GameFramework/Character.h"
#include "GameFramework/Actor.h"
#include "FPSCharacter.generated.h"
^^ I tried adding “GameFramework/Actor.h” that didn’t change anything. Tried with / without that include
my includes on FPSCharacter.cpp
#include "FPSCharacter.h"
#include "GameFramework/Actor.h"
^^ Tried with / without #include “GameFramework/Actor.h” as well.
How come in that guys video his compiles and I’m stuck here… trying to figure it out.
I’m starting with looking into documentation and starting to learn some of the unreal classes / functions / properties of objects like character,pawn,actor, etc.
Thanks in advance guys!