# Access methods of HitActor made from blueprint (based on C++ parent class)

**URL:** <https://forums.unrealengine.com/t/access-methods-of-hitactor-made-from-blueprint-based-on-c-parent-class/781028>\
**Category:** C++\
**Tags:** inheritance, hit-result, unreal-engine, question, Blueprint, CPP\
**Created:** [March 1, 2023, 7:49am UTC](https://forums.unrealengine.com/t/access-methods-of-hitactor-made-from-blueprint-based-on-c-parent-class/781028 "2023-03-01T07:49:11Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Olivetum](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/olivetum/32/599596_2.png) [@Olivetum](https://forums.unrealengine.com/u/Olivetum)\
**Post date:** [March 1, 2023, 7:49am UTC](https://forums.unrealengine.com/t/access-methods-of-hitactor-made-from-blueprint-based-on-c-parent-class/781028/1 "2023-03-01T07:49:11Z")

</div>

Hi. I am learning Unreal alongside C++ and have lost somewhere between C++ derived Blueprint and OutHit.

**The setup:**  
I have a **UsableObject** parent class that provides a simple UseObject() method that for now just ulog “Object can be used”. Then I created a child class called **Door** that also has UseObject() method that should output “Doors opened”. At the end I’ve created Blueprint derived from **Door** class (for now I didn’t handle meshes from c++) to add skeletal mesh and place it on a level.

The player has a component named **ObjectHandler** that is doing SweepSingleByChannel() and on HitResult I would like to access UseObject method but the only thing I could figure out, for now, is casting to AUsableObject that is outputting standard ‘Object can be used’.

This is how I access it now:

```auto
FHitResult HitResult;
if (UObjectHandler::GetObjectInReach(HitResult) && !hasHit) {
  AActor* HitActor = HitResult.GetActor();
  if (HitActor->GetClass()->IsChildOf(AUsableObject::StaticClass())) {
    AUsableObject* UsableObject = Cast<AUsableObject>(HitActor);
	UsableObject->UseObject();
  }
}

```

I guess the problem is with virtual/override keywords for USeObject(), but when I add them I got a linker error.

The base class:

```auto
virtual void UseObject()

```

and then override in child class

```auto
void UseObject() override;

```

I got this error:

> CompilerResultsLog: Undefined symbols for architecture x86\_64:  
> CompilerResultsLog: “ADoor::UseObject()”, referenced from:  
> CompilerResultsLog: vtable for ADoor in Door.gen.cpp.o  
> CompilerResultsLog: ld: symbol(s) not found for architecture x86\_64  
> CompilerResultsLog: clang: error: linker command failed with exit code 1 (use -v to see invocation)

Can someone point me to right path here? 😉

---

<div class="post-metadata">

**Author:** ![Olivetum](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/olivetum/32/599596_2.png) [@Olivetum](https://forums.unrealengine.com/u/Olivetum)\
**Post date:** [March 1, 2023, 7:57am UTC](https://forums.unrealengine.com/t/access-methods-of-hitactor-made-from-blueprint-based-on-c-parent-class/781028/2 "2023-03-01T07:57:04Z")

</div>

Ok. I found a stupid error… in child class I did

```auto
void UseObject()

```

Instead of

```auto
void ADoor::UseObject()

```

■■■■!!!
