# first time OnConstruction is called after duplication Actor still has default class values

**URL:** <https://forums.unrealengine.com/t/first-time-onconstruction-is-called-after-duplication-actor-still-has-default-class-values/301423>\
**Category:** C++\
**Tags:** duplicate, unreal-engine, bug-report, CPP, question\
**Created:** [December 12, 2014, 7:54pm UTC](https://forums.unrealengine.com/t/first-time-onconstruction-is-called-after-duplication-actor-still-has-default-class-values/301423 "2014-12-12T19:54:46Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![TS100101](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@TS100101](https://forums.unrealengine.com/u/TS100101)\
**Post date:** [December 12, 2014, 7:54pm UTC](https://forums.unrealengine.com/t/first-time-onconstruction-is-called-after-duplication-actor-still-has-default-class-values/301423/1 "2014-12-12T19:54:46Z")

</div>

It’s also gets called 4 times, which is really inconvenient if you make anything expensive inside OnConstruction.

I’m using 4.6, btw.

Here’s a project to reproduce issue.

Steps:

- Place a MyActor into level (MyActor logs its Value property every time OnConstruction is called).
- Change Value property to something else in Details panel.
- Alt-Drag actor to duplicate it.
- If you take a look at Output Log you should see something like 0,N,N,N (where N is whatever value you assigned to Value property).

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_33800a51](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_33800a51](https://forums.unrealengine.com/u/anonymous_user_33800a51)\
**Post date:** [December 16, 2014, 10:33pm UTC](https://forums.unrealengine.com/t/first-time-onconstruction-is-called-after-duplication-actor-still-has-default-class-values/301423/2 "2014-12-16T22:33:34Z")

</div>

Hey TS100101,

It looks like project you attached is missing its Contents folder, so there’s no MyActor. If you could and attach that .uasset we can look into it. I wasn’t able to reproduce this, so if you can’t get us that asset please give us some details on how it was set up. Thanks!

---

<div class="post-metadata">

**Author:** ![TS100101](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@TS100101](https://forums.unrealengine.com/u/TS100101)\
**Post date:** [December 16, 2014, 10:48pm UTC](https://forums.unrealengine.com/t/first-time-onconstruction-is-called-after-duplication-actor-still-has-default-class-values/301423/3 "2014-12-16T22:48:48Z")

</div>

Hi .

MyActor is a C++ class, it’s on source folder, that’s why there’s no Content folder.

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_33800a51](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_33800a51](https://forums.unrealengine.com/u/anonymous_user_33800a51)\
**Post date:** [December 18, 2014, 11:32pm UTC](https://forums.unrealengine.com/t/first-time-onconstruction-is-called-after-duplication-actor-still-has-default-class-values/301423/4 "2014-12-18T23:32:06Z")

</div>

Hey TS100101,

Ah, I didn’t realize you had created a new class. I was able to reproduce issue you described, and have entered a bug report for our developers to look at (UE-6902). I’ll let you know when I see an update. Thanks for report!

---

<div class="post-metadata">

**Author:** ![TS100101](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@TS100101](https://forums.unrealengine.com/u/TS100101)\
**Post date:** [December 19, 2014, 7:58pm UTC](https://forums.unrealengine.com/t/first-time-onconstruction-is-called-after-duplication-actor-still-has-default-class-values/301423/5 "2014-12-19T19:58:26Z")

</div>

Great! Thank you .
