# Cannot add custom graphics to scene

**URL:** <https://phaser.discourse.group/t/cannot-add-custom-graphics-to-scene/3905>\
**Category:** Phaser 3\
**Created:** [October 9, 2019, 10:10am UTC](https://phaser.discourse.group/t/cannot-add-custom-graphics-to-scene/3905 "2019-10-09T10:10:22Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![dbjsdev2](https://avatars.discourse-cdn.com/v4/letter/d/e495f1/32.png) [@dbjsdev2](https://phaser.discourse.group/u/dbjsdev2)\
**Post date:** [October 9, 2019, 11:45pm UTC](https://phaser.discourse.group/t/cannot-add-custom-graphics-to-scene/3905/3 "2019-10-09T23:45:16Z")

</div>

That is the class from which my object extends, so it is definitely using the Phaser 3 API

The developer in the link below has done what I am trying to do. So it must have worked at some point. Unless this functionality has since been removed.

> [@Extended Graphics and cannot make mouse interactions work](https://phaser.discourse.group/t/extended-graphics-and-cannot-make-mouse-interactions-work/1205):
>
> I’m new to phaser and I have a custom class that extends Graphics. I want to trigger a function when the object is clicked. The code shown below draws the unit but never registers any events. If instead, I try passing “this” to setInteractive then the onClick fires any time the mouse is over any part of the canvas. Is there a way to specify a hit box for registering clicks? Thanks! class Unit extends Phaser.GameObjects.Graphics { constructor(scene, x, y, stats){ super(scene, x…

---

_[View the full topic](https://phaser.discourse.group/t/cannot-add-custom-graphics-to-scene/3905)._
