ギリギリになりましたが、2025/2/11までの無料アセットを紹介します。
ざっくり
SICKA DYNASTYは中華系のお寺や竜の像などが入った環境系です。建物はモジュラー形式なので、そういう舞台が必要になった場合には役に立つかも。重め。

Clay Potsは土器25個で4GBのちょっとファイルサイズでかすぎアセットですがそのうち3.5GBくらいはライトベイクされた情報とのこと。。。
あと、Lowpoly側も結構ポリゴン数があるとのこと。。。

よっしーの環境ではデモレベルが激重でなかなか起動せず未確認。
個人的本命は Ultimate Interaction Manager | Fab
でしたが、マニュアルが簡素でバグも多く、ちょっと現時点ではお薦めし難い内容でした(;^ω^)

Discordに参加して、レシートを管理者に承認されると非公開ページが見れたり、サポートを受けられるとのことです。(英語)
ほかにもたくさんシステム系アセットを作られている方なので、ほかにも使いたいものがある方は検討されてみては。
とはいえ、すべてBPで作られていて、自分でインタラクションシステムを作る際にも参考にできることも多々あるので、勉強がてら中身を見てみるのはおすすめいたします。
実装を説明するのは営業妨害になるので、本記事では、使い方のみ紹介します。

たぶん現時点どこよりも詳しい解説記事でしょうw
基本的コンセプトは、
インタラクション(ものを取る・扉開けるなどの作用)させたいものにコンポーネントを追加したら、あとはちょっとした設定だけで、アイコン表示させたり、開始・終了・更新イベントを作れるよ
といったものです。



プレイヤー(操作する側)準備
サードパーソンテンプレートで説明します。
1.IMC_Default に InputAction_Interaction を登録し、Eキーを割当て(なんでもOK)

2. ワールドセッティング(or ゲームモード)で プレイヤーコントローラ を新規作成し設定

ここでは NewPlayerController という名前にしています。
3. NewPlayerController に Manager_InteractionTarget を追加

キーアサイン設定処理は、サードパーソンテンプレートではBP_ThirdPersonCharacterでやっているので必要ありません。
※ ローカル判定している処理を追加したほうがいいかもしれませんが、バグが多そうなのでサーバーでは使えないかも。。。
4.リスポーンとかキャラ変・キーマップ変更する場合は、PlayerController_Interaction の下側の処理をコピペでつなぐ

もの側の設定
1. 対話したいアクタに Manager_InteractionTarget コンポーネントを追加

2. 詳細/Interaction Settings / Interaction Typeをえらぶ
Tap ワンタップ・Hold 長押し・Repeat 連打
3. 詳細欄下のほう On Interaction** イベントを使って、やりたい処理を実装する

- Begin 開始 必ず動く
- End 終了 たぶん必ず動く : ステータス 完了 / キャンセル
- Update 更新 : alpha 進捗率、 Repeated 連打回数
- Reactivated 再起動 EndのあとDuration経過後
- Deactivated 停止 EndのあとDuration経過後
Begin/End は開始直後、終了時に必ず動く
End は連打・長押しを途中でやめた場合も動く(Resultの列挙子で完了/キャンセルが判別可)

更新は長押し・連打用。Alphaで進捗率0~1、Repeatedで連打の回数カウント。
End後に一発動く場合があるので要注意


連打には時間内に次押さないと回数が減るクールダウン時間設定あり
Reactivated (再起動時) / Deactivated (停止時) は終了方法選択次第で動く/動かないケースあり

使いたい場合は0秒でもいいので「After Duration」を含む「On Finished/Finish Method」を選ぶ

困りごと
途中からインタラクト可能に切り替える方法がなさげ
→ コリジョンは動的につくられるので、GetChildComponentなどで検索してNoCollisionにするとか?
用語
POI : Point of Interest 注目する点 ここになんかアイテムあるよ

サイレントヒルでアイテムあるところに「〇」でるやつですね
大事そうな設定
- Marker Settings
- Marker Component Name: 目印出す位置をコンポーネント名で指定
- Interaction Settings
- Interaction Zone Component to Attach: コリジョン中心をコンポーネント名で指定
- Inner Zone Radius: 内側コリジョンサイズ 操作できる距離
- Outer Zone Extent: 外側コリジョンサイズ POIアイコンが表示される距離
- Interaction Type: 操作タイプ タップ/連打/長押し
- On Finished
- Finish Method: 作用後の状態 消去/自動復帰/停止 (と操作タイプの組合せで17種類)
Marker Component Name
目印出す位置をコンポーネント名で指定する(指定コンポーネントの原点+オフセットで調整可能)

左から MarkerTarget、Cylinder、CollisionTarget、hoge(存在しない場合はアクタ原点)を指定
何もないところを指定したいときはシーンコンポーネントなどを追加する
Interaction Zone Component to Attach
コリジョン中心をコンポーネント名で指定

左から MarkerTarget、Cylinder、CollisionTarget、hoge(存在しない場合はアクタ原点)を指定
留意点
- Sphereコリジョンのみ
- レベル編集中は非表示で、ゲーム中の非表示はEnable Debugオン/オフで切り替え可能
Inner Zone Radius / Outer Zone Extent
内 Innerがインタラクション操作可能になる(マーカー表示する)コリジョン
外 OuterがPOI表示するコリジョン
- 内外の中心位置は同じ
- 外径は内径に「追加する」幅指定 かつ 最小10

inner100で+extentが10なら外径は110です
Interaction Type
操作タイプ Tap 1回押す/ Repeat 連打/ hold 長押し



Finish Method
17種類 (下記の組み合わせ)
- 終了タイプ
- Destroy: アクタごと破壊される
- Reactivate: 再起動 再度インタラクションできる状態に戻る
- Deactivate: 停止 アクタは残るが使えなくなる
- 状況タイプ
- Completed: 完了
- Cancel: 中断
- タイマー
- なし
- After Duration: End後、〇秒経過後に終了状態に移行

その他設定
プレイヤー側
Interactor Manager: プレイヤーコントローラに追加したこのコンポーネントをクリックすると、詳細パネルに設定オプションが表示されます。

Default Widget Pool Size:デフォルトのウィジェットプールサイズ: 再生開始時に作成されるウィジェット数を制御します。このシステムは、メモリを節約するためにウィジェットプールを使用しています。

ようは、あらかじめプレイヤーにアイコン用のウィジェットを何個作るか。
Pending Target Check Interval: 保留ターゲットチェック間隔: 保留ターゲットリストをチェックする秒数。ティックと同じように考え、このフロートの値によって保留中のターゲットをチェックし、もし保留中のターゲットがなければ、ティックは全く行われない。
Interaction Input Action: インタラクション入力アクション: インタラクションのために定義する入力アクションのリファレンス。
Widget Screen Margin:ウィジェット画面マージン: 画面の4辺の画面外インジケータのマージンを制御します。
Screen Radius Percent:スクリーン半径パーセント: 0~1 オフスクリーンインジケータの半径をコントロールします。これは、オフスクリーンマーカーにサークルエフェクトを作成します。

下2つは設定変えてもよくわかりませんでした(;’∀’)
もの側
Display Progress: 進捗を表示するフラグ: プログレスバーの表示をコントロールします。false の場合、進捗を表示する代わりにランダムなアニメーションを再生します。
Display Triangle: 三角形を表示するフラグ: プログレスバーに三角形のアイコンを表示します。
Flash POI/Target Icon: マーカーを点滅させるかフラグ
Rotate Interaction Icon: プログレスバーのアイコンを回転させるかフラグ
Colors And Icons: 色とアイコン設定
Highlight Settings アウトライン強調によりハイライトさせるもの指定。コンポーネント単位で配列へ登録。そのひとつひとつにアウトラインシェーダが適用されます。
Interaction Text: 各インタラクション状態のテキストを追加します。

押し続けるのか連打かは伝えないとイラつかせちゃうよね
Interaction Type: インタラクションのタイプをタップ、ホールド、リピートから選択します。
Network Handle Method: インタラクション中に他のプレイヤーがインタラクションするのをブロックするか、有効にしておきます。

マルチプレイ対応だけど、イマイチちゃんと動かない?いろいろエラーでる
Hold Seconds: 長押し秒数。
Repeat Count: リピート回数
Repeat Cooldown: リピート時の各タップ間の秒数。
Cooldown Enabled: クールダウン有効: 無効にするとキャンセルされるまで待ちます。

キャンセルされるまで待ちます
の意味わからず。。。
Display Interaction Key: 相互作用キーを表示する: 画面上のプログレスバーにキーを表示します。
Use Custom Keys: カスタムキーを使用する: すべての入力を無効にし、配列からカスタムキーをチェックする。
Custom Keys: カスタムキー チェックするキーの配列。基本はプレイヤー側で設定したIAに紐づくけど、別なキーで操作させたい場合に指定できるもの。(デモでは最初のブースで右のやつがFキーになっている)
表示サイズ関連
マーカーの種類・色や文字は指定できるけど、ウィジェットのサイズは個別に設定する機能はないので、直接ウィジェットのサイズを変更する必要があります。

各コンテナのWidth/Height Overrideや

Textのフォントサイズ
Triangle ▽は円の中心からの距離を設定します。

おまけ(Simulate Physics
Simulate Physicsを使いたい場合、ルートがシーンコンポーネントだとコリジョンがついてこない
たぶんコリジョンはコンストラクト時にルートの子になっているので、メッシュが動いてもついてこない(メッシュの名前を指定しても、メッシュの子関係にしたものを指定してもNG)
ルートをSimulate Physics対象メッシュにするとよさげ
ルートがシーンコンポーネントの場合

ルートがメッシュの場合

設定方法

シーンコンポーネントをムーバブルにする

と、置き換えできるので、Simulate Physics有効なCubeをアクタのルートにする

おわりに
私は多分今後使いません。。が、いろいろ勉強になりました。

実行ピンがひとつもつながらなくてもタイムライン定義できるんだな など
コメント