# Using Own Class for APawn

**URL:** <https://forums.unrealengine.com/t/using-own-class-for-apawn/311330>\
**Category:** Programming & Scripting\
**Tags:** unreal-engine\
**Created:** [March 17, 2015, 5:42am UTC](https://forums.unrealengine.com/t/using-own-class-for-apawn/311330 "2015-03-17T05:42:25Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![XAfgun\_1](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@XAfgun\_1](https://forums.unrealengine.com/u/XAfgun_1)\
**Post date:** [March 17, 2015, 5:42am UTC](https://forums.unrealengine.com/t/using-own-class-for-apawn/311330/1 "2015-03-17T05:42:25Z")

</div>

class CLIENT\_API AMyActor : public AActor

class ENGINE\_API APawn : public AMyActor, public INavAgentInterface

I got this error

Error 1 error : Duplicate class name: AMyActor also exists in file /Script/Engine …\Intermediate\ProjectFiles\LogCompile projectName

How can I use AMyActor as base class for APawn ???

Thanks a lot …

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_957a4452](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_957a4452](https://forums.unrealengine.com/u/anonymous_user_957a4452)\
**Post date:** [March 18, 2015, 9:24am UTC](https://forums.unrealengine.com/t/using-own-class-for-apawn/311330/2 "2015-03-18T09:24:29Z")

</div>

Hi xAfgun,

```
How can I use AMyActor as base class for APawn ???

```

You should not do it. Instead of this, you can create class derived from APawn and add some functionality you need. To use your own pawn class go to Editor → Settings World Settings → Game Mode → Selected GameMode → Default Pawn Class.

Hope it helps!
