LoginSignup
8
6

More than 3 years have passed since last update.

【UE4】UFUNCTIONの種類【UnrealEngine】【C++】

Last updated at Posted at 2020-04-05

UFUNCTIONのブループリント(BP)関係の指定子による挙動一覧表

指定子 BP側で呼び出し可能か    BPのイベントとして使えるか    C++で処理を書けるか   
BlueprintCallable 〇      ×    〇   
BlueprintPure 〇      ×    〇   
BlueprintImplementableEvent ×         ×   
BlueprintNativeEvent ×         〇   

BlueprintCallable

BP側で呼べるようになる。
関数の後ろにconst を付けると実行ピンを持たないノードになる。
主にC++で書いた処理をBPで呼び出したい時に使う
Callable.png

BlueprintPure

Blueprintからの呼び出しが可能。
実行ピンを持たないノードになる。

BlueprintImplementableEvent

C++で処理を実装する事は出来ず、BPのイベントとして処理を書ける。
C++側で関数を呼び出すこともできる為、主にBPで作った処理をC++で呼び出したい時に使う。

BlueprintNativeEvent 

BlueprintNativeEventはC++で処理を書きたい場合

UFUNCTION(BlueprintNativeEvent)
void CountdownHasFinished(); 
virtual void CountdownHasFinished_Implementation(); // C++で中身を書くのはこっちだけ

virtual void 〇〇_Implementation();と記述しソースファイルに処理を書きこむ

C++.gif
出てきたのもノードで繋げればC++で作った処理も通る

エラーになる書き方

BlueprintImplementableEventやBlueprintNativeEventなどイベントとして扱う関数はソースを作成してしまうとエラーになる

8
6
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
8
6