# I've Casted to An AI Character's parent, "Cast to Character." What is the object reference for that?

**URL:** <https://forums.unrealengine.com/t/ive-casted-to-an-ai-characters-parent-cast-to-character-what-is-the-object-reference-for-that/2122344>\
**Category:** Blueprint\
**Tags:** casting, aicontroller, unreal-engine, characters, cast, question, Blueprint\
**Created:** [November 14, 2024, 12:51pm UTC](https://forums.unrealengine.com/t/ive-casted-to-an-ai-characters-parent-cast-to-character-what-is-the-object-reference-for-that/2122344 "2024-11-14T12:51:02Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![Maximum.Dino](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Maximum.Dino](https://forums.unrealengine.com/u/Maximum.Dino)\
**Post date:** [November 14, 2024, 12:51pm UTC](https://forums.unrealengine.com/t/ive-casted-to-an-ai-characters-parent-cast-to-character-what-is-the-object-reference-for-that/2122344/1 "2024-11-14T12:51:02Z")

</div>

I need to cast to an AI Character. It’s parent class/object is “Character.” Now, it says it’s valid for the character to cast to the Ai Character, but I have no idea what to use for the object reference for the “Cast to Character” Node. The image below depicts exactly what I mean.

[https://drive.google.com/drive/folders/1r5yOzPPBbvz-tUXzJCQGJBNvdCT9iR1m?usp=sharing](https://drive.google.com/drive/folders/1r5yOzPPBbvz-tUXzJCQGJBNvdCT9iR1m?usp=sharing)

I’d say I’m pretty good in Unreal Engine, but I’m absolutely terrible at understanding casting.

---

<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:** [November 14, 2024, 1:05pm UTC](https://forums.unrealengine.com/t/ive-casted-to-an-ai-characters-parent-cast-to-character-what-is-the-object-reference-for-that/2122344/2 "2024-11-14T13:05:10Z")

</div>

Casting takes you ‘down’ the inheritance tree.

If you had a character reference, you could cast it to your AI Character.

You could also cast an actor reference to Character or your AI Character.

You need a reference to start with… Casting does not get you the reference.

---

<div class="post-metadata">

**Author:** ![Maximum.Dino](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Maximum.Dino](https://forums.unrealengine.com/u/Maximum.Dino)\
**Post date:** [November 14, 2024, 1:12pm UTC](https://forums.unrealengine.com/t/ive-casted-to-an-ai-characters-parent-cast-to-character-what-is-the-object-reference-for-that/2122344/3 "2024-11-14T13:12:16Z")

</div>

how would you get a reference then?

---

<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:** [November 14, 2024, 1:24pm UTC](https://forums.unrealengine.com/t/ive-casted-to-an-ai-characters-parent-cast-to-character-what-is-the-object-reference-for-that/2122344/4 "2024-11-14T13:24:23Z")

</div>

What are you trying to do? How many AI do you have?

---

<div class="post-metadata">

**Author:** ![Maximum.Dino](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Maximum.Dino](https://forums.unrealengine.com/u/Maximum.Dino)\
**Post date:** [November 14, 2024, 1:29pm UTC](https://forums.unrealengine.com/t/ive-casted-to-an-ai-characters-parent-cast-to-character-what-is-the-object-reference-for-that/2122344/5 "2024-11-14T13:29:05Z")

</div>

I have one AI of this exact character, but I have 10 different ai characters. I only need this one, though. I’m trying to cast to them so I can access and change relationship status values within the ai’s variables.

---

<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:** [November 14, 2024, 1:30pm UTC](https://forums.unrealengine.com/t/ive-casted-to-an-ai-characters-parent-cast-to-character-what-is-the-object-reference-for-that/2122344/6 "2024-11-14T13:30:27Z")

</div>

So it sounds like you need ‘get actor of class’?

---

<div class="post-metadata">

**Author:** ![Maximum.Dino](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Maximum.Dino](https://forums.unrealengine.com/u/Maximum.Dino)\
**Post date:** [November 14, 2024, 1:35pm UTC](https://forums.unrealengine.com/t/ive-casted-to-an-ai-characters-parent-cast-to-character-what-is-the-object-reference-for-that/2122344/7 "2024-11-14T13:35:02Z")

</div>

maybe! I did try that and it gave me an error. If I put the ‘get actor of class’ in the object reference, the casting doesn’t work, and if I remove the casting and just keep the ‘get actor of class,’ I get a runtime error

[https://drive.google.com/drive/folders/1r5yOzPPBbvz-tUXzJCQGJBNvdCT9iR1m?usp=drive\_link](https://drive.google.com/drive/folders/1r5yOzPPBbvz-tUXzJCQGJBNvdCT9iR1m?usp=drive_link)

---

<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:** [November 14, 2024, 1:45pm UTC](https://forums.unrealengine.com/t/ive-casted-to-an-ai-characters-parent-cast-to-character-what-is-the-object-reference-for-that/2122344/8 "2024-11-14T13:45:06Z")

</div>

What I’m saying is, you don’t need to cast. **Just** get actor. This

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/a/b/9/ab9ade9b1537f9b2f437c50e3c2c475effc769ba.jpeg)

looks fine. But if you’re getting ‘none’ errors, it means there just isn’t a BP\_AIGibbes in the level.

Do you have one in the level ( map )?

---

<div class="post-metadata">

**Author:** ![Maximum.Dino](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Maximum.Dino](https://forums.unrealengine.com/u/Maximum.Dino)\
**Post date:** [November 14, 2024, 1:54pm UTC](https://forums.unrealengine.com/t/ive-casted-to-an-ai-characters-parent-cast-to-character-what-is-the-object-reference-for-that/2122344/9 "2024-11-14T13:54:22Z")

</div>

Oh… Oops. I don’t. I didn’t know that was required but that makes sense. I’m having problems adding the character to the blueprint, not sure why… I’ll figure that out, though  
Thank you!

---

<div class="post-metadata">

**Author:** ![system](https://d3kjluh73b9h9o.cloudfront.net/original/4X/7/1/3/713c9d3f58553f0de89543d76a8a3a2779dc9fa4.png) [@system](https://forums.unrealengine.com/u/system)\
**Post date:** [December 14, 2024, 1:54pm UTC](https://forums.unrealengine.com/t/ive-casted-to-an-ai-characters-parent-cast-to-character-what-is-the-object-reference-for-that/2122344/10 "2024-12-14T13:54:31Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
