0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

UE5勉強日記2025/04/13 mouse指す場所の座標取得

Posted at

image.png
上記BlueprintのBreak hit ResultのLoctionはmouse指す場所の座標です。

説明

まず、Convert Mouse Location To World Space出力するworld location,World Directionについて説明
world locationはゲーム世界中のmouseの座標
World DirectionはMouse指す方向

次、Line Trace For Objectは特定の方向にレイ(光線)を飛ばし、衝突したオブジェクトを検出するもの
startはmouseの座標を設定しました
endはmouse指す方向の単位ベクトル * Distanceを設定しました
※Distanceの初期値困る場合は、int型 4000を設定してください。
Object Typeはworld static

それで、Mouseからmouse指す方向 4000距離以内にworld staticが存在したら、hit resultを返す
そのhit resultはmouse指す場所の座標です。

0
0
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
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?