Hi,
So, Is it truly necessary to declare variables every tick, as in Grabber.cpp, inside void UGrabber::TickComponent?
// Called every frame
void UGrabber::TickComponent(float DeltaTime, ......
{
Super::TickComponent(DeltaTime, TickType, ThisTickFunction);
// Get player view point every tick
FVector PlayerViewPointLocation;
FRotator PlayerViewPointRotation;
.....
}
Wouldn’t have been easier to put them under Grabber.h as
UCLASS( ClassGroup=(Custom), meta=(BlueprintSpawnableComponent) )
class BUILDINGESCAPE_API UGrabber : public UActorComponent
{
GENERATED_BODY()
private:
FVector PlayerViewPointLocation;
FRotator PlayerViewPointRotation;
for example?
Cheers
/Nicolas.