# Character Not Valid in Animation Blueprint

**URL:** <https://forums.unrealengine.com/t/character-not-valid-in-animation-blueprint/1195012>\
**Category:** Character & Animation\
**Tags:** unreal-engine, FeatureRequest, characters, Blueprint, question, blendspace\
**Created:** [June 10, 2023, 3:33pm UTC](https://forums.unrealengine.com/t/character-not-valid-in-animation-blueprint/1195012 "2023-06-10T15:33:05Z")\
**Posts on this page:** 17\
**Page:** 1

<div class="post-metadata">

**Author:** ![CorsairOfLight](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/corsairoflight/32/485641_2.png) [@CorsairOfLight](https://forums.unrealengine.com/u/CorsairOfLight)\
**Post date:** [June 10, 2023, 3:33pm UTC](https://forums.unrealengine.com/t/character-not-valid-in-animation-blueprint/1195012/1 "2023-06-10T15:33:05Z")

</div>

Hey All,

Been a long time since posting here. How are you doing?

 ![ABPClass](https://d3kjluh73b9h9o.cloudfront.net/original/4X/0/8/a/08aa0ff61eca97f64d58f7c827d2776b4e757b0e.png)

 ![AI](https://d3kjluh73b9h9o.cloudfront.net/original/4X/5/3/9/53943852a19b78b74f4f865e497317b7b0d1ba6a.png)

So I’m having trouble with my Animation Blueprint for one of my AI-driven characters. It turns out, the AI works great, but the Animation Blueprint does not.

 ![ABP](https://d3kjluh73b9h9o.cloudfront.net/original/4X/4/d/9/4d9a5c140450c0afd9c8be0e244fd1058e851c09.png)

I’ve tried a Print String node on every branch of that sequence here, and found that it is not receiving Exec from Update Animation, due to the Character Reference not being Valid.

My State Machine is in perfect working order, there are no bad rules in it.

 ![StateMachine](https://d3kjluh73b9h9o.cloudfront.net/original/4X/c/a/2/ca2fe2e014f6a719d0f71db5b461437ac25fadb1.png)  
 ![Rule](https://d3kjluh73b9h9o.cloudfront.net/original/4X/e/3/4/e345bfaf8230d1e9ea2a80fa26b57c090a6abae7.png)

I don’t know if it is my Mesh or not, but it seems that it may be the culprit. It has a Root and operates just fine in Blender.

In addition, I looked up other possible culprits on the internet, but applied their solutions to no avail.

 ![RootMotion](https://d3kjluh73b9h9o.cloudfront.net/original/4X/6/0/b/60b34df8b7aed2559e7cb592f510ed8597285bf0.png)  
 ![Paths](https://d3kjluh73b9h9o.cloudfront.net/original/4X/e/f/d/efd0808c269c23c19f9f6e6f79d9a9481130df41.png)

What could possibly be making my character invalid? Interesting fact, after plugging in a print string to the success and fail Execs on my casting, it seems that the casting only works 50% of the time as well.

---

<div class="post-metadata">

**Author:** ![3dRaven](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/3draven/32/906552_2.png) [@3dRaven](https://forums.unrealengine.com/u/3dRaven)\
**Post date:** [June 10, 2023, 3:42pm UTC](https://forums.unrealengine.com/t/character-not-valid-in-animation-blueprint/1195012/2 "2023-06-10T15:42:09Z")

</div>

Your character variable is invalid because you are not setting it anywhere. It’s a nullptr until you pass in a value to set it.

During “Event Blueprint Initialize Animation” where you have get owner casting to a character node then you should get the out pin an pass that to set the character variable.

If you character variable is of a specific blueprint implementation then get owner and cast to the variable type and then set it.

---

<div class="post-metadata">

**Author:** ![CorsairOfLight](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/corsairoflight/32/485641_2.png) [@CorsairOfLight](https://forums.unrealengine.com/u/CorsairOfLight)\
**Post date:** [June 10, 2023, 3:43pm UTC](https://forums.unrealengine.com/t/character-not-valid-in-animation-blueprint/1195012/3 "2023-06-10T15:43:15Z")

</div>

Oops. That was obvious, lol.

Thanks. I will try it and see if it keeps doing the same thing.

---

<div class="post-metadata">

**Author:** ![CorsairOfLight](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/corsairoflight/32/485641_2.png) [@CorsairOfLight](https://forums.unrealengine.com/u/CorsairOfLight)\
**Post date:** [June 10, 2023, 4:04pm UTC](https://forums.unrealengine.com/t/character-not-valid-in-animation-blueprint/1195012/4 "2023-06-10T16:04:11Z")

</div>

3dRaven, you are awesome! This little common mistake was fixed and now it runs 50% better.

The other thing that seems to be happening is my Character Blueprint is not communicating with the Animation Blueprint.

 ![AnimInstance](https://d3kjluh73b9h9o.cloudfront.net/original/4X/8/d/6/8d6337f8ac02ff698065e87b994a240c1f81315a.png)

The cast seems to be failing-- any idea why?

---

<div class="post-metadata">

**Author:** ![3dRaven](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/3draven/32/906552_2.png) [@3dRaven](https://forums.unrealengine.com/u/3dRaven)\
**Post date:** [June 10, 2023, 4:06pm UTC](https://forums.unrealengine.com/t/character-not-valid-in-animation-blueprint/1195012/5 "2023-06-10T16:06:27Z")

</div>

Does the mesh component “Mesh” have it’s anim instance set to the ABP\_…V2 anim instance type blueprint?  
Is it of type skeletal mesh component? (Only those can have anim instances if I remember correctly)

---

<div class="post-metadata">

**Author:** ![CorsairOfLight](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/corsairoflight/32/485641_2.png) [@CorsairOfLight](https://forums.unrealengine.com/u/CorsairOfLight)\
**Post date:** [June 10, 2023, 4:08pm UTC](https://forums.unrealengine.com/t/character-not-valid-in-animation-blueprint/1195012/6 "2023-06-10T16:08:29Z")

</div>

Forgot to put this in the original posting:

 ![ABPClass](https://d3kjluh73b9h9o.cloudfront.net/original/4X/0/8/a/08aa0ff61eca97f64d58f7c827d2776b4e757b0e.png)

---

<div class="post-metadata">

**Author:** ![3dRaven](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/3draven/32/906552_2.png) [@3dRaven](https://forums.unrealengine.com/u/3dRaven)\
**Post date:** [June 10, 2023, 4:10pm UTC](https://forums.unrealengine.com/t/character-not-valid-in-animation-blueprint/1195012/7 "2023-06-10T16:10:28Z")

</div>

It should work. You could try adding a 0.1 second delay before the cast just in case. Perhaps it’s not initialized? Sometimes unreal has these quirks.

Is this a multiplayer game or single?

---

<div class="post-metadata">

**Author:** ![CorsairOfLight](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/corsairoflight/32/485641_2.png) [@CorsairOfLight](https://forums.unrealengine.com/u/CorsairOfLight)\
**Post date:** [June 10, 2023, 4:11pm UTC](https://forums.unrealengine.com/t/character-not-valid-in-animation-blueprint/1195012/8 "2023-06-10T16:11:31Z")

</div>

Single so far, but there are plans for multi.

I’ll try that. It’s currently connected to the Character BP’s BeginPlay.

---

<div class="post-metadata">

**Author:** ![3dRaven](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/3draven/32/906552_2.png) [@3dRaven](https://forums.unrealengine.com/u/3dRaven)\
**Post date:** [June 10, 2023, 4:13pm UTC](https://forums.unrealengine.com/t/character-not-valid-in-animation-blueprint/1195012/9 "2023-06-10T16:13:16Z")

</div>

You could also push this function to a place when you need the variable. Then check if it’s valid, if not then go through the init process that you now have at begin play.

---

<div class="post-metadata">

**Author:** ![CorsairOfLight](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/corsairoflight/32/485641_2.png) [@CorsairOfLight](https://forums.unrealengine.com/u/CorsairOfLight)\
**Post date:** [June 10, 2023, 4:14pm UTC](https://forums.unrealengine.com/t/character-not-valid-in-animation-blueprint/1195012/10 "2023-06-10T16:14:09Z")

</div>

You are a lifesaver man. Keep up the good will.

Trying this now.

---

<div class="post-metadata">

**Author:** ![CorsairOfLight](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/corsairoflight/32/485641_2.png) [@CorsairOfLight](https://forums.unrealengine.com/u/CorsairOfLight)\
**Post date:** [June 10, 2023, 4:27pm UTC](https://forums.unrealengine.com/t/character-not-valid-in-animation-blueprint/1195012/11 "2023-06-10T16:27:13Z")

</div>

Apparently, because it is an AIController controlling the Character Blueprint, the normal Movement Input scripts do not apply. How do I get into those AI movements? _Should_ I get into those?

---

<div class="post-metadata">

**Author:** ![3dRaven](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/3draven/32/906552_2.png) [@3dRaven](https://forums.unrealengine.com/u/3dRaven)\
**Post date:** [June 10, 2023, 4:51pm UTC](https://forums.unrealengine.com/t/character-not-valid-in-animation-blueprint/1195012/12 "2023-06-10T16:51:07Z")

</div>

Ai is usually guided by behaviour trees.

Inside of them you usually call ai move to in specific behaviours.

---

<div class="post-metadata">

**Author:** ![CorsairOfLight](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/corsairoflight/32/485641_2.png) [@CorsairOfLight](https://forums.unrealengine.com/u/CorsairOfLight)\
**Post date:** [June 10, 2023, 9:01pm UTC](https://forums.unrealengine.com/t/character-not-valid-in-animation-blueprint/1195012/13 "2023-06-10T21:01:02Z")

</div>

How would you access turning behavior? Specifically?

---

<div class="post-metadata">

**Author:** ![3dRaven](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/3draven/32/906552_2.png) [@3dRaven](https://forums.unrealengine.com/u/3dRaven)\
**Post date:** [June 10, 2023, 9:02pm UTC](https://forums.unrealengine.com/t/character-not-valid-in-animation-blueprint/1195012/14 "2023-06-10T21:02:56Z")

</div>

AI characters move along paths that are generated by the navmesh. You don’t steer them in the way of “go forward”, “turn left” etc.

---

<div class="post-metadata">

**Author:** ![CorsairOfLight](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/corsairoflight/32/485641_2.png) [@CorsairOfLight](https://forums.unrealengine.com/u/CorsairOfLight)\
**Post date:** [June 10, 2023, 10:33pm UTC](https://forums.unrealengine.com/t/character-not-valid-in-animation-blueprint/1195012/15 "2023-06-10T22:33:55Z")

</div>

So there’s no way to assign turn animations to their movements?

---

<div class="post-metadata">

**Author:** ![3dRaven](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/3draven/32/906552_2.png) [@3dRaven](https://forums.unrealengine.com/u/3dRaven)\
**Post date:** [June 10, 2023, 10:36pm UTC](https://forums.unrealengine.com/t/character-not-valid-in-animation-blueprint/1195012/16 "2023-06-10T22:36:11Z")

</div>

Check some tutorials about AI. It’s a rather broad subject. It would take a lot of explaining but there are a lot of resources out there that will explain it better and faster than I can.

[![](https://d3kjluh73b9h9o.cloudfront.net/original/4X/7/b/8/7b85eec05d6d3e771788e34b346a879a2b8c2fa6.jpeg "Unreal Engine AI with Behavior Trees | Unreal Engine") ](https://www.youtube.com/watch?v=iY1jnFvHgbE)

---

<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:** [July 10, 2023, 10:36pm UTC](https://forums.unrealengine.com/t/character-not-valid-in-animation-blueprint/1195012/17 "2023-07-10T22:36:52Z")

</div>

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