# Accessed none error despite class and expose on spawn

**URL:** <https://forums.unrealengine.com/t/accessed-none-error-despite-class-and-expose-on-spawn/463744>\
**Category:** UI\
**Tags:** interface, actor, ue, accessed-none, unreal-engine, Blueprint, question\
**Created:** [April 14, 2020, 3:10am UTC](https://forums.unrealengine.com/t/accessed-none-error-despite-class-and-expose-on-spawn/463744 "2020-04-14T03:10:06Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![ThaGuyWithCake](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@ThaGuyWithCake](https://forums.unrealengine.com/u/ThaGuyWithCake)\
**Post date:** [April 14, 2020, 3:10am UTC](https://forums.unrealengine.com/t/accessed-none-error-despite-class-and-expose-on-spawn/463744/1 "2020-04-14T03:10:06Z")

</div>

So I’m trying to make a global reference to a blueprint that acts as a parent class for my pickup items.For example, the pickup actor blueprint here: [Imgur: The magic of the Internet](https://imgur.com/a/LrWcXVG)

First image is the pickup actor that holds the call to interact with the object. I can’t however access the parent master item class which (Second picture has the function I’m literally trying to access). I’m out of ideas, I tried a foreach loop to get all actors of class for master item, tried a soft actor reference and have tried to print out the casts fail/successes but no matter what I do, I just can’t access bpmaster item, specifically, the ‘On Used’ function inside master item.

Can someone please help me? I think I’m missing out on something and I am looking online for help, but the majority of casts are for things like beginoverlap, or simply plugging in character player/controller (bp masteritem does not inherit either).

---

<div class="post-metadata">

**Author:** ![ClockworkOcean](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/clockworkocean/32/1169999_2.png) [@ClockworkOcean](https://forums.unrealengine.com/u/ClockworkOcean)\
**Post date:** [April 14, 2020, 8:52am UTC](https://forums.unrealengine.com/t/accessed-none-error-despite-class-and-expose-on-spawn/463744/2 "2020-04-14T08:52:58Z")

</div>

The blue underline on the cast means you don’t need to cast, as the object is already what you want.

Also, you don’t need to check if it’s valid, that’s what the cast is for 🙂

But you do need to check the array of actors is at least 1 in length, I think you’ll find it’s zero…

---

<div class="post-metadata">

**Author:** ![ThaGuyWithCake](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@ThaGuyWithCake](https://forums.unrealengine.com/u/ThaGuyWithCake)\
**Post date:** [April 14, 2020, 9:04am UTC](https://forums.unrealengine.com/t/accessed-none-error-despite-class-and-expose-on-spawn/463744/3 "2020-04-14T09:04:41Z")

</div>

Thank you for response. Would I use a get actors of all class and run that through a foreach loop? How could I check the length?

---

<div class="post-metadata">

**Author:** ![ClockworkOcean](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/clockworkocean/32/1169999_2.png) [@ClockworkOcean](https://forums.unrealengine.com/u/ClockworkOcean)\
**Post date:** [April 14, 2020, 9:07am UTC](https://forums.unrealengine.com/t/accessed-none-error-despite-class-and-expose-on-spawn/463744/4 "2020-04-14T09:07:32Z")

</div>

Pull a pin from the array and type ‘length’ 🙂

---

<div class="post-metadata">

**Author:** ![ThaGuyWithCake](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@ThaGuyWithCake](https://forums.unrealengine.com/u/ThaGuyWithCake)\
**Post date:** [April 14, 2020, 9:11am UTC](https://forums.unrealengine.com/t/accessed-none-error-despite-class-and-expose-on-spawn/463744/5 "2020-04-14T09:11:14Z")

</div>

Interesting… It returns a 0 (null?) I know how to get references to gameinstance, hud, playercharacter/pawn/owner, but nothing on just making a blueprint ‘global’ if that makes sense, as I just want to call a function in it and the same function in its child classes hence me trying to call it’s class rather than use an actor object reference.

---

<div class="post-metadata">

**Author:** ![ClockworkOcean](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/clockworkocean/32/1169999_2.png) [@ClockworkOcean](https://forums.unrealengine.com/u/ClockworkOcean)\
**Post date:** [April 14, 2020, 9:28am UTC](https://forums.unrealengine.com/t/accessed-none-error-despite-class-and-expose-on-spawn/463744/6 "2020-04-14T09:28:00Z")

</div>

If you’re getting nothing back, it means there are no actors of that type available. You need to place one, or spawn one…

---

<div class="post-metadata">

**Author:** ![ThaGuyWithCake](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@ThaGuyWithCake](https://forums.unrealengine.com/u/ThaGuyWithCake)\
**Post date:** [April 14, 2020, 9:49am UTC](https://forums.unrealengine.com/t/accessed-none-error-despite-class-and-expose-on-spawn/463744/7 "2020-04-14T09:49:42Z")

</div>

Tried to spawn actor via blueprint, it did not like that… Child classes unfortunately do not seem to inherit interfaces. Will figure something out.
