# How can I play a blend space 1d from code?

**URL:** <https://forums.unrealengine.com/t/how-can-i-play-a-blend-space-1d-from-code/284101>\
**Category:** Programming & Scripting\
**Tags:** unreal-engine\
**Created:** [May 23, 2014, 9:07pm UTC](https://forums.unrealengine.com/t/how-can-i-play-a-blend-space-1d-from-code/284101 "2014-05-23T21:07:51Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![Rama](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/rama/32/882413_2.png) [@Rama](https://forums.unrealengine.com/u/Rama)\
**Post date:** [May 24, 2014, 3:26am UTC](https://forums.unrealengine.com/t/how-can-i-play-a-blend-space-1d-from-code/284101/2 "2014-05-24T03:26:42Z")

</div>

Custom Animation Blueprint

You need a custom animation blueprint class (anim instance)

then you can create a variable that you interpolate in the code, to connect to the 1D Blend Space

In code, obtain your custom anim instance from the character

and then interpolate your custom variable which is attached to the 1D blendspace in The Animation Blueprint

```
UYourAnimInstance * Animation = 
  Cast<UYourAnimInstance>( Mesh->GetAnimInstance() );
if(!Animation) return;
 
Animation->BlendAlpha = FMath::FInterpTo(Animation->BlendAlpha,1,GDeltaTime,7);

```

#Wiki tutorial

> **[A new, community-hosted Unreal Engine Wiki](https://forums.unrealengine.com/t/a-new-community-hosted-unreal-engine-wiki/141494)**
>
> After over a year in maintenance mode, the official Unreal Engine Wiki is now permanently offline. These resources now live on a new community-run Unreal Engine Community Wiki — ue4community.wiki! You will be able to find content from the official...

> **[A new, community-hosted Unreal Engine Wiki](https://forums.unrealengine.com/t/a-new-community-hosted-unreal-engine-wiki/141494)**
>
> After over a year in maintenance mode, the official Unreal Engine Wiki is now permanently offline. These resources now live on a new community-run Unreal Engine Community Wiki — ue4community.wiki! You will be able to find content from the official...

Rama

---

_[View the full topic](https://forums.unrealengine.com/t/how-can-i-play-a-blend-space-1d-from-code/284101)._
