# c++とブループリント間の変数値引き渡し

**URL:** <https://forums.unrealengine.com/t/c/27002>\
**Category:** 日本語 (Japanese)\
**Tags:** unreal-engine\
**Created:** [April 10, 2015, 1:53am UTC](https://forums.unrealengine.com/t/c/27002 "2015-04-10T01:53:40Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![anonymous\_user\_f8210bc5](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_f8210bc5](https://forums.unrealengine.com/u/anonymous_user_f8210bc5)\
**Post date:** [April 10, 2015, 1:53am UTC](https://forums.unrealengine.com/t/c/27002/1 "2015-04-10T01:53:40Z")

</div>

c++からjavascriptを呼び出してプログラムを実行させ、実行結果の変数をc++のグローバル変数に代入して、ブループリントで変数として使いたいと思うのですが、これは可能でしょうか？  
どなたかお分かりの方がいたらご教示いただきたいです。

---

<div class="post-metadata">

**Author:** ![alwei](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/alwei/32/1194579_2.png) [@alwei](https://forums.unrealengine.com/u/alwei)\
**Post date:** [April 11, 2015, 1:49pm UTC](https://forums.unrealengine.com/t/c/27002/2 "2015-04-11T13:49:06Z")

</div>

C++とブループリント間の変数値引き渡しは、特に問題なく可能ですがJavascriptを実行する事がそのままでは難しいです。  
Javascriptプラグインを導入する必要がありますが、現在のUE4バージョンで動くかはわかりません。

V8 Javascriptプラグイン

> **[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...

ちなみにUE4の中では基本的にグローバル変数は扱えません。  
厳密には扱う事は出来ますが様々な制約が多いので使用しない事を推奨します。

C++とブループリントの値引き渡しはC++上でプロパティを作成すれば、UE4の中でC++とブループリント両方で使用出来ます。  
詳しい話は以下のドキュメントを参考にしてみてください。

> **[C++ とブループリント](https://docs.unrealengine.com/4.27/ja/ProgrammingAndScripting/ClassCreation/CodeAndBlueprints/)**
>
> ゲームプレイ プログラマ向けの Unreal Engine 入門書
