# \[Bug\] Can't make calls to parent class for DamageType

**URL:** <https://forums.unrealengine.com/t/bug-cant-make-calls-to-parent-class-for-damagetype/415296>\
**Category:** Blueprint\
**Tags:** parent-class, unreal-engine, bug-report, question, Blueprint\
**Created:** [January 22, 2018, 9:59pm UTC](https://forums.unrealengine.com/t/bug-cant-make-calls-to-parent-class-for-damagetype/415296 "2018-01-22T21:59:24Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![anonymous\_user\_a830416f](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_a830416f](https://forums.unrealengine.com/u/anonymous_user_a830416f)\
**Post date:** [January 22, 2018, 9:59pm UTC](https://forums.unrealengine.com/t/bug-cant-make-calls-to-parent-class-for-damagetype/415296/1 "2018-01-22T21:59:24Z")

</div>

To repro:

1: Make a subclass of the Native DamageType called “DamageBase” in BP.

2: Add a function called “TheFunction” to that class that passes a variable of type “Actor”

3: Make a subclass of DamageBase and attempt to override “TheFunction” with a call to the parent.

4: Notice it will create the parent function call node but if you hook it up and compile you will get this error:

“Function Parent: The Function can modify state and cannot be called on ‘self’ because it is a read-only Target in this context”

I’m not sure if there’s something I’m doing wrong here but I would like to be able to put functionality into the base of my damage types and call them from children.

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_942e8e52](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_942e8e52](https://forums.unrealengine.com/u/anonymous_user_942e8e52)\
**Post date:** [January 22, 2018, 10:54pm UTC](https://forums.unrealengine.com/t/bug-cant-make-calls-to-parent-class-for-damagetype/415296/2 "2018-01-22T22:54:02Z")

</div>

Hello ,

The tooltip for damage type states that they are to be treated as “immutable data holders with static code functionality”

I’m no programmer, but when researching what immutable meant I came across this: “The key concept is to understand that instead of modifying something you create something new with your change applied” ([Understanding Immutability and Pure Functions (for OOP) · David Raab](https://sidburn.github.io/blog/2016/03/14/immutability-and-pure-functions))

In this video it looks like he is putting functionality in the parent damage class, and using the children to hold information about the type of damage.

Hope that helps!

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_a830416f](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_a830416f](https://forums.unrealengine.com/u/anonymous_user_a830416f)\
**Post date:** [January 23, 2018, 5:17pm UTC](https://forums.unrealengine.com/t/bug-cant-make-calls-to-parent-class-for-damagetype/415296/3 "2018-01-23T17:17:52Z")

</div>

I figured it was something like along these lines. I ended up moving my functionality into another class.

It would be ideal if BP communicated the concept of an immutable somehow either through the icon in the generic browser and/or by giving some contextual feedback in the BP window. The tooltip is difficult to discover.
