Skip to content

Instantly share code, notes, and snippets.

@ityulkanov
Created January 20, 2017 16:50
Show Gist options
  • Save ityulkanov/9a30e8cb31727e3b2691d8231df9cabb to your computer and use it in GitHub Desktop.
Save ityulkanov/9a30e8cb31727e3b2691d8231df9cabb to your computer and use it in GitHub Desktop.
// Fill out your copyright notice in the Description page of Project Settings.
#pragma once
#include "Components/ActorComponent.h"
#include "Grabber.generated.h"
UCLASS( ClassGroup=(Custom), meta=(BlueprintSpawnableComponent) )
class BUILDINGESCAPE_API UGrabber : public UActorComponent
{
GENERATED_BODY()
public:
// Sets default values for this component's properties
UGrabber();
// Called when the game starts
virtual void BeginPlay() override;
// Called every frame
virtual void TickComponent( float DeltaTime, ELevelTick TickType, FActorComponentTickFunction* ThisTickFunction ) override;
private:
float Reach = 100.f; // How far ahead should the player reach
void Grab();
///CALLED WHEN GRAB IS REALEASED
void Release();
UPhysicsHandleComponent * PhysicsHandle = nullptr;
UInputComponent * InputComponent = nullptr;
//raycast and grab whats in greach
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment