Recreating Half Life ALYX VR mechanics inside of Unreal Engine 4 🀓 Quick Selecttion Part2

Human Codeable
5 Apr 202023:55

Summary

TLDRこのビデオでは、Half-Life Alyxからむンスピレヌションを埗たクむックセレクションメニュヌの完成を目指したす。最初にホバヌ゚フェクトを改善し、マテリアル属性を倉曎しお茝きず䞍透明床を増やしたす。次に、ハンマヌリングの゚フェクトを確認し、VRヘッドセットを装着せずに゚ディタで確認したす。そしお、手ず銃のメッシュを調敎し、アニメヌションを定矩したす。さらに、モヌションコントロヌラヌずの重なりを怜出しお、右手のみに反応するように蚭定したす。アニメヌションブルヌプリントを敎理し、゚フェクトをテストしたす。最埌に、クむックメニュヌの衚瀺ず消去のアニメヌションを実装し、銃のロゞックを远加しお、トリガヌを抌すず発射されるようにしたす。

Takeaways

  • 🛠 スクリプトは、Half-Life Alyxのクむック遞択メニュヌを完成させるプロセスを説明しおいたす。
  • 🎚 最初のチュヌトリアルでは、スケヌルを䞀床だけ倉曎しおホバヌ゚フェクトを䜜りたしたが、今回はマテリアル属性もホバヌ゚フェクトに反映させたす。
  • 🔩 ハマヌリングの゚フェクトを゚ディタで確認するために、ここでは接続を行いたす。
  • 🀲 ハンドずガンのメッシュをむンポヌトし、調敎しおガンに合わせおフィットさせおいたす。
  • 🔄 モヌションコントロヌラヌずの重なりを確認し、右手のみでトリガヌするようにスむッチを蚭定したす。
  • 🗂 ガンポヌズを列挙型に远加し、アニメヌションのブレンドを実装したす。
  • 🎮 アニメヌションブルヌプリントを敎理し、䞍芁の倉数を削陀しおクリヌンなアプロヌチで䜜り盎したす。
  • 📡 モヌションコントロヌラヌから䞍芁な機胜を削陀し、新しいカスタムむベントを䜜成しおパフォヌマンスを向䞊させたす。
  • 🔧 クむックメニュヌの衚瀺/非衚瀺を管理するためのカスタムむベントを䜜成し、アニメヌションを逆再生しおメニュヌを消去したす。
  • 🔫 ガンのロゞックを実装し、トリガヌを抌すず「ぺうぺう」ず衚瀺されるようにしたす。
  • 🎯 クむック遞択メニュヌの各ボタンを配列に収集し、メニュヌの閉じる時にコリゞョンを無効にしたす。

Q & A

  • ビデオでは䜕を制䜜しおいたすか

    -ビデオでは、Half-Life Alyxのクむックセレクションメニュヌを完成させるプロセスを玹介しおいたす。

  • ホバヌ゚フェクトを改善するために䜕を倉曎したしたか

    -ホバヌ゚フェクトを改善するために、以前䜜成したマテリアル属性を倉曎しお、より倚くのグロヌず透明床を远加したした。

  • VRヘッドセットを䜿わずに゚ディタで効果を確認する方法は䜕ですか

    -ホバヌ゚フェクトを確認するために、゚ディタでハンマヌリングに接続しお効果を確認する方法を䜿甚したした。

  • 銃のメッシュを調敎し、それをどのように゚クスポヌトしたしたか

    -銃のメッシュを調敎し、それをスケルタルメッシュずしお゚クスポヌトしたした。

  • Motion Controllerずの重なりを怜出するために䜕をしたしたか

    -Motion Controllerずの重なりを怜出するために、トリガヌにホバヌしおいるずきにモヌションコントロヌラヌに察しおキャストを行いたした。

  • アニメヌションブルヌプリントで䜕を削陀したしたか

    -アニメヌションブルヌプリントで、以前のすべおのアニメヌションず倉数を削陀し、よりクリヌンなアプロヌチで䜜り盎したした。

  • クむックセレクションメニュヌの衚瀺ず非衚瀺を切り替えるためにどのようなアプロヌチを䜿甚したしたか

    -クむックセレクションメニュヌの衚瀺ず非衚瀺を切り替えるために、アニメヌションの再生ず逆再生を䜿甚したした。

  • 入力蚭定で新しいカスタムむベントを䜜成する理由は䜕ですか

    -新しいカスタムむベントを䜜成するこずで、ティック関数でのキャストを避け、パフォヌマンスを向䞊させるこずができたした。

  • アクティブなツヌルを切り替えるロゞックはどのように実装されおいたすか

    -アクティブなツヌルを切り替えるロゞックは、Enumを䜿甚しお状態を管理し、状態に応じお異なるむベントを呌び出すこずで実装されおいたす。

  • 銃のロゞックをテストするために行ったこずは䜕ですか

    -銃のロゞックをテストするために、トリガヌが抌されたずきに'pew pew'ずいう文字列をプリントする機胜を远加したした。

  • クむックセレクションメニュヌのボタンを参照するためにどのような方法を䜿甚したしたか

    -クむックセレクションメニュヌのボタンを参照するために、子アクタヌずしおキャストし、実際のボタンを通じお参照するメ゜ッドを䜿甚したした。

  • プロゞェクトのサポヌトを求める方法はありたすか

    -プロゞェクトをサポヌトするために、Patreonをチェックしおサポヌトを提䟛するよう呌びかけおいたす。

Outlines

00:00

🛠 ハヌフラむフアレックスのクむック遞択メニュヌの改良

この段萜では、ハヌフラむフアレックスのクむック遞択メニュヌを改善するプロセスが説明されおいたす。ホバヌ゚フェクトの匷化やマテリアル属性の倉曎、VRヘッドセットを䜿甚せずに゚ディタでのテスト、そしおアニメヌションずメッシュの調敎が行われおいたす。さらに、モヌションコントロヌラヌずの重なりを怜出しお、右の手のみがトリガヌできるようにスむッチを蚭定し、アニメヌションの遷移を管理するための倉数を䜜成しおいたす。

05:02

🎚 アニメヌションブルヌプリントの敎理ず最適化

第2段萜では、アニメヌションブルヌプリントを敎理し、よりクリヌンなアプロヌチで䜜り盎す方法が玹介されおいたす。アニメヌショングラフを削陀し、Enumを䜿甚しおアニメヌションステヌトを定矩し、様々なポヌズをブレンドする方法が説明されおいたす。たた、アニメヌションプレビュヌ゚ディタを䜿甚しお動䜜を確認し、モヌションコントロヌラヌの蚭定を倉曎しおパフォヌマンスを向䞊させる方法も提案されおいたす。

10:04

🔧 クむックセレクトメニュヌの機胜実装

この段萜では、クむックセレクトメニュヌの機胜を実装するプロセスが詳述されおいたす。トリガヌの巊ず右の入力を远加し、メニュヌの衚瀺ず非衚瀺を制埡するカスタムむベントを䜜成しおいたす。さらに、コンテキストに応じたトリガヌプレスむベントを凊理し、アクティブなツヌルに応じお異なるアクションを実行するように蚭定しおいたす。

15:11

🎮 ガンずツヌルのロゞックの実装ずテスト

第4段萜では、ゲヌム内のガンずツヌルのロゞックの実装ずテストが行われおいたす。シンプルなスタティックメッシュずしおガンずツヌルを䜜成し、アクティブなツヌルの管理方法を説明しおいたす。さらに、ガンにショット機胜を远加し、トリガヌプレスむベントを怜出しお発砲するロゞックを実装しおいたす。

20:13

🏹 ガンのロゞックの匷化ずプロゞェクトルの远加

最埌の段萜では、ガンのロゞックを匷化し、プロゞェクトルを远加するプロセスが玹介されおいたす。マテリアルの蚭定、矢印を䜿甚した発射䜍眮の取埗、シンプルなプロゞェクトルの䜜成ず発射ロゞックの実装が行われおいたす。たた、モヌションコントロヌラヌの蚭定を倉曎しお、アクティブなツヌルを適切に管理する方法も説明されおいたす。

Mindmap

Keywords

💡クむックセレクションメニュヌ

クむックセレクションメニュヌずは、ゲヌム内で玠早くアむテムや歊噚を遞択するためのむンタヌフェヌスのこずです。このビデオでは、Half-Life Alyxのクむックセレクションメニュヌを完成させる方法が説明されおいたす。䟋えば、メニュヌから銃や道具を遞択し、ゲヌム内で䜿甚するこずができるようになりたす。

💡マテリアル属性

マテリアル属性ずは、3Dモデルに適甚される芖芚効果の蚭定のこずです。ビデオでは、ホバヌ゚フェクトを実珟するためにマテリアル属性を倉曎し、より明るく䞍透明床を高める方法が玹介されおいたす。これにより、メニュヌの遞択肢をホバヌした時により目立぀効果が埗られたす。

💡アニメヌション

アニメヌションは、ゲヌム内のキャラクタヌやオブゞェクトの動きを衚珟する技術です。ビデオでは、ハンドアニメヌションを䜜成し、銃や道具ずの互換性を確保するために䜿甚されおいたす。䟋えば、遞択したアむテムに応じお手の圢を倉えるアニメヌションが実装されおいたす。

💡スケルタルメッシュ

スケルタルメッシュは、3Dモデルの構造を定矩するメッシュで、アニメヌションに䜿甚される骚栌に基づいおいたす。ビデオでは、銃や道具のメッシュをスケルタルメッシュずしおむンポヌトし、アニメヌションずの敎合性を保ちたす。これにより、手が銃に適切にフィットするように調敎されたす。

💡゚ネム

゚ネムenumerationずは、プログラミングで甚いる列挙型の略で、ある皮の定数倀をグルヌプ化したものです。ビデオでは、゚ネムを䜿甚しお銃や道具など異なるアニメヌションの状態を定矩し、簡単に切り替えるこずができたす。

💡カスタムむベント

カスタムむベントずは、特定のアクションが発生した際に実行される独自のむベントです。ビデオでは、状態が倉化した際にアニメヌションを倉曎するための「On State Changed」ずいうカスタムむベントを䜜成しおいたす。これにより、アニメヌションの流れをスムヌズに制埡するこずができたす。

💡モヌションコントロヌラヌ

モヌションコントロヌラヌは、VR環境䞋で手の動きを怜出するためのデバむスです。ビデオでは、モヌションコントロヌラヌを䜿甚しお、プレむダヌの手がメニュヌず重なった堎合にのみアむテムを遞択できるようにしおいたす。これにより、よりリアルな操䜜感を提䟛したす。

💡アニメヌションブルヌプリント

アニメヌションブルヌプリントは、Unreal Engineで䜿甚されるアニメヌションを䜜成および線集するためのビゞュアルツヌルです。ビデオでは、アニメヌションブルヌプリントを䜿甚しお、銃や道具のアニメヌションを䜜り、さたざたな状態に基づくアニメヌションのブレンドを実装しおいたす。

💡ス폰アクタヌ

スポンアクタヌずは、ゲヌム内でオブゞェクトを生成するこずを指したす。ビデオでは、銃や道具を遞択した際に、そのオブゞェクトをスポンしおゲヌム内に出す方法が説明されおいたす。これにより、プレむダヌは遞択したアむテムを手で扱うこずができたす。

💡プロゞェクトル

プロゞェクトルずは、ゲヌム内の匟䞞やその他の飛び道具を衚すオブゞェクトです。ビデオでは、銃で発射されるプロゞェクトルを䜜成し、その動きを蚭定しおいたす。これにより、プレむダヌは銃を䜿甚しお敵に攻撃できるようになりたす。

Highlights

Improving the hover effect in the quick selection menu from Half-Life Alyx tutorial by changing material attributes for a glowing and opacity effect.

Integrating functionalities into the quick selection menu which currently has no active features.

Testing the hammer ring effect in the editor without using a VR headset.

Exporting and importing gun mesh and adjusting it to fit for skeletal mesh import.

Creating a new socket for the gun and defining a specific animation for the hand.

Casting to the motion controller to check for overlaps and setting up hand switches for right-hand triggers.

Using an enum to add gun pose and change animation states for testing purposes.

Creating an 'active state' variable to manage different states in the selection button.

Adjusting animations for different tools and hands using child print buttons and enum list.

Importing and positioning tool meshes, creating sockets, and assigning them to the enum list.

Deleting and reworking the animation blueprint for a cleaner approach.

Using state-dependent blending of poses in the animation graph for skeletal mesh.

Testing animation states in the animation preview editor.

Modifying the motion controller blueprint for better performance and custom event creation.

Setting up input actions for quick menu access and trigger inputs.

Creating custom events for quick selection menu appearance and disappearance.

Handling trigger pressed events context-sensitively based on the current state.

Forwarding inputs to the active tool from the motion controller.

Adding logic to the gun for shooting and testing the functionality.

Getting references to all buttons in the quick selection menu for animation control.

Disabling collision for the trigger when closing the quick selection menu.

Creating a simple projectile blueprint for the gun's shooting mechanism.

Spawning and managing the active tool or gun based on the current state.

Finalizing the quick selection menu setup and considering further polishing.

Transcripts

play00:03

hey guys

play00:05

and e42 here and today we are going to

play00:08

finish the quick selection menu from

play00:11

half-life Alex so the first thing I want

play00:14

to do today is to improve the holla

play00:17

effect a little bit in the first

play00:19

tutorial we only changed the scale once

play00:22

we hover over it right now I want to

play00:24

change the material attributes we

play00:26

created earlier to also represent a

play00:29

hovering effect so I want to have a

play00:32

little bit more glow and also increase

play00:34

the opacity a little bit and once we are

play00:43

finished here we really start with all

play00:46

the functionalities because right now

play00:48

nothing is really happening so let's do

play00:52

this today for a quick test I'm going to

play00:57

connect this here so I can see the

play01:00

effect of the hammer ring in the editor

play01:01

because I don't wanna put on my VR

play01:04

headset right now and the next thing

play01:08

would be it to really do the pauses for

play01:11

our grabbing so I just exported the hand

play01:14

and imported my gun mesh and I'm

play01:19

adjusting the mesh to really fit the gun

play01:21

and export it as a skeletal mesh import

play01:24

it into you Andrea I'm going to create a

play01:28

new socket for the gun and here I can

play01:31

define a specific animation so in this

play01:33

case here's the hand animation I am

play01:37

going to add the gun mesh and now I can

play01:41

position the socket that the hand really

play01:45

fits the gun so in the selection button

play01:50

itself

play01:57

once I hover over my trigger

play02:00

I want to cast to the motion controller

play02:03

to see if it's really the motion

play02:04

controller overlapping I want to make a

play02:07

switch on the hand the reason for this

play02:10

is I only want the right hand to trigger

play02:14

this overlap so this way the left hand

play02:22

will be completely ignored by this I'm

play02:25

also going to make a variable out of it

play02:28

because later if we end the hovering I

play02:32

want to check if it's the the actual

play02:35

right hand that is leaving and only if

play02:44

it is the right hand I want to reverse

play02:47

the animation you could have caused also

play02:57

do the casting again but it's a little

play03:00

bit cleaner and also more back safe to

play03:05

do it this way so let's go into the enum

play03:14

itself and actually add our gun pose in

play03:17

here so now I can choose it from the

play03:22

enum and I can really change things I'm

play03:26

going to do a little different approach

play03:30

later on but right now just for testing

play03:33

purposes let's do it this way I created

play03:37

a new variable called active state

play03:39

and this is the one I'm going to use

play03:41

later on to really change between the

play03:43

different states

play03:47

I'm going to open on my child who print

play03:51

buttons I created earlier and now I can

play03:53

change the activated state for each

play03:56

so for the gun I can say use the gun

play03:59

animation for the to later on I can say

play04:02

use the tool animation and for the hand

play04:05

I want just the open animation so let's

play04:10

quickly do the same for the tool I

play04:12

imported the mesh here and I'm doing my

play04:16

crap house once I finished I'm also

play04:28

going to import it again make sure to

play04:32

select the same skeleton and then I'm

play04:36

creating a new socket again at my

play04:38

preview mesh of the tool and position

play04:45

the socket the right way

play04:59

so this will be the position the two

play05:02

later on will be spawned so I'm also

play05:04

adding this tool here to my enum list

play05:08

and assign it to the child crew print

play05:12

button so here comes a fun part let's

play05:20

open up the skeletal mesh and go into

play05:23

the animation blueprint and what is in

play05:26

here is really not a good example of how

play05:28

to do this at all so we're going to

play05:31

delete everything in here and make it

play05:34

with a much cleaner approach so we open

play05:39

up the animation graph also we delete

play05:41

everything that is in here so it kind of

play05:45

works for this demonstration but it's

play05:47

really not good for production so we

play05:51

also get rid of the variables we don't

play05:54

need here we're just working with the

play05:56

State so depending on the

play06:06

state we have selected we want to blend

play06:10

the poses so we have the possibility

play06:14

with right-click to add all the policies

play06:17

from our innum list in here so we are

play06:19

going to add all of them and for every

play06:23

enum entry we can define an animation

play06:26

state so it really blends into this pose

play06:29

here and you can switch between the

play06:31

different poses the cool thing is this

play06:34

is for the skeletal mesh and it's really

play06:36

blending so it's not just setting this

play06:39

animation is really blending between all

play06:42

of them and you can use it with a

play06:44

different hand also if it's using the

play06:47

same skeleton you can use every hand you

play06:50

want for example we have three different

play06:52

hand meshes with the same skeleton in

play06:55

our as a pack and you can switch between

play06:57

all three of them and all this logic

play07:00

will work seamlessly

play07:02

this is a really nice approach and it's

play07:04

very clean because we really use the

play07:07

curb states from the enum here and you

play07:19

can also test to see if everything is

play07:21

working if you go to the animation

play07:24

preview editor on the right side and

play07:28

here you can switch between the crap

play07:31

States and you can see that the hand is

play07:33

slapping into the positions and you can

play07:36

play around with the splint I'm here if

play07:37

you want to have as a fast or slower

play07:39

blend but let's keep it for now and now

play07:45

I'm going into the motion controller and

play07:48

there's a lot of stuff in there that is

play07:51

really not not that great for the

play07:53

purpose we are using here so I'm just

play07:55

going to modify and delete quite a lot

play07:58

of stuff in here

play07:59

I'm also making a new custom event for

play08:05

this because you really don't want to

play08:06

have this in the tick it's really not

play08:09

performant and there's better ways of

play08:12

integrating this kind of functionality

play08:14

so I'm creating a custom event call it

play08:18

on State changed and this is the

play08:21

one I'm going to correlate home also I

play08:24

really don't want to cast in the tick

play08:26

every time so it's enough if I cast at

play08:30

the beginning once and create a variable

play08:34

out of this so I'm doing this same thing

play08:38

he's done in the tick but I'm doing it

play08:41

at the begin play once and I'm going to

play08:43

save this variable and this way I just

play08:46

can refer to a variable later on

play08:49

and it's much better performance wise to

play08:52

do it this way basically you should

play08:56

really try to keep your tick clean and

play08:59

especially don't do any for loops or a

play09:02

lot of casting in there so for now I'm

play09:07

just doing the set state this is

play09:11

basically just for the animation

play09:12

blueprint and we are going to modify

play09:17

this later on also going to delete this

play09:20

here and clean this up even more for now

play09:29

now I don't want to handle the

play09:30

teleportation stuff so I'm just leaving

play09:33

it the way it is we may need to

play09:36

integrate this later on so the next

play09:40

thing would be to open up our input

play09:42

settings and at our functionalities so I

play09:44

want one for the quick menu and I'm

play09:53

using the thumbstick pressed of course

play09:56

you can use your own ones but make sure

play09:59

to remove it from the teleportation

play10:01

because they also use the thumbstick

play10:04

pressed so I removed it here and I also

play10:10

added inputs for my trigger left and

play10:13

trigger right

play10:19

so let's open up our motion controller

play10:22

create a new custom event called import

play10:25

quick select let's create a new boolean

play10:28

called set and depending on if it is

play10:30

pressed or not the set is true or false

play10:35

so if it's true I want to spawn my menu

play10:40

actually so let's select the class in

play10:43

there we get the word transform from the

play10:48

hand mesh right now and also save the

play10:54

menu as a variable so this way I can

play10:57

later on call my events on this so let's

play11:02

do a quick check if the variable is

play11:05

still valid if I let go of the button

play11:07

and also create a new event in our quick

play11:14

selection menu for the disappearing it's

play11:17

just basically the reverse from the

play11:20

appear animation right now and I want to

play11:24

make sure if it's backwards in the end I

play11:26

want to destroy my actor so back in the

play11:30

pawn I can now call my input quick

play11:32

select if pressed it is set to true and

play11:34

if released it a set of false this way I

play11:38

can call the two different events

play11:40

depending on the pressed state of the

play11:42

button and if it's set to false and a

play11:45

quick selection menu is still valid I

play11:47

want to play the disappear disappear

play11:50

animation

play12:02

and now let's handle the actual trigger

play12:05

pressed event this I want to be context

play12:08

sensitive depending on the crib state

play12:10

I'm currently in so I want to make

play12:13

different things father if the crib

play12:16

status gun for example I want to shoot

play12:18

if it's on the tool I want to do

play12:19

something with the tool and now if I set

play12:22

it up this way I can really forward the

play12:24

inputs to the actual tool that is active

play12:27

right now for a quick test

play12:37

I'm just doing a print string with pew

play12:40

pew and to time let's go into our motion

play12:43

controller pan and set this up so for

play12:45

the left controller I want to call the

play12:48

function trigger pressed and I'm doing

play12:52

the same for the right controller and

play12:55

this way you can really forward all your

play12:58

inputs into the controller itself and

play13:01

there if necessary follow-up them to the

play13:05

tools

play13:22

so let's add the enum to the actual

play13:26

event so this way I can just define the

play13:29

enum I want to have into my event here

play13:32

set us set the variable and also set it

play13:35

in my animation blueprint I'm also going

play13:48

to create a van event dispatcher I'm not

play13:51

using it right now but this might be

play13:53

handy handy later on so I edit it for

play13:58

now so now I can remove my test here I

play14:05

did earlier I'm going to keep the

play14:07

activated trip State but now I want to

play14:09

call the event I have just created and I

play14:13

want to set my activated State in

play14:15

here and connect everything up again so

play14:22

now every time the State has

play14:24

changed

play14:25

I can call different events for example

play14:28

if I switch to the gun I want to spawn

play14:30

the actual gun and if I switch back to

play14:33

the hand I want to destroy the tool or

play14:36

the gun so let's do this right now let's

play14:40

do a simple spawn actor note and also

play14:42

snap it to the component and make sure

play14:45

to use the right socket name in here

play14:50

so for the gun it was a socket gun I'm

play14:54

also going to spawn the mesh at the

play14:56

exact same position of the socket so

play14:59

it's already in the right place we do

play15:03

the same for the tool and right now we

play15:10

don't have the actors yet so there's no

play15:13

gun and there is no tool so let's create

play15:15

them for the beginning they are very

play15:19

simple and also this is something

play15:22

different

play15:23

then half-life Alex because in there

play15:26

they really made a fixed tool so you

play15:30

cannot drop it or throw it away in our

play15:33

case you would be even able to throw the

play15:35

gun at your enemies if you want to but

play15:39

for now it's just a simple static mesh

play15:41

that has been spawned and attached so

play15:45

let's select the actual blueprints we

play15:47

just created one for the gun the other

play15:49

further tool and we are also going to

play15:58

create a variable out of it so we have a

play16:00

reference to our gun and one for our

play16:04

tool

play16:20

so here I'm doing a quick check if the

play16:24

gun is already spawned and if so I want

play16:26

to delete the old one and spawn a new

play16:29

one but I'm going to change this later

play16:33

on to be year for the active tool

play16:35

because I don't want to not only to

play16:38

de-spawn a gun but every tool that is

play16:41

active right now let's do the same for

play16:43

the tool so let's create a new variable

play16:59

called active tool and this is just an

play17:01

actor reference and if the gun is being

play17:07

store pawned the gun will be the active

play17:09

tool if the tools being spawned the tool

play17:11

will be the active tool and if I select

play17:18

one of the other trap houses here for

play17:20

example the open or the crab or the

play17:22

king-crab I want to destroy the active

play17:25

tool if it's valid so this way I am back

play17:35

to the original hand pause without any

play17:37

tool in there let's go to our gun and

play17:41

give it some logic so for now I'm just

play17:44

doing the pew pew to see if it's

play17:47

forwarded correctly to the gun

play17:51

so now if I hit the trigger pressed and

play17:55

the state is actually gun I want to

play17:57

call this shoot function from the gun

play17:59

and see if it's already working so let's

play18:02

do a quick test I can select the gun and

play18:05

now if I press the trigger you can see

play18:08

the string is firing so this is already

play18:12

working fine

play18:15

[Music]

play18:21

the next thing I want to do is I want to

play18:25

get a reference to all my buttons in my

play18:27

quick selection menu so because they are

play18:30

child actors I need to first cast to my

play18:32

child and then cast through the actual

play18:35

button and I'm going to add all of them

play18:37

into an array and I'm also doing a

play18:41

function out of it because I'm doing

play18:43

this three times so now I have this

play18:46

function called @ button to array and I

play18:49

am calling this function for all my free

play18:51

child actors so this way in the end all

play18:55

of them will be in this array and this

play18:59

seems a little bit complicated but it's

play19:01

necessary for child actors so now if I

play19:06

call the disappear event for each of my

play19:08

buttons I will also call the

play19:11

disappearing event so they scare down

play19:14

and once all of the child actors are

play19:20

scared down I want to reverse the

play19:22

animation of my actual appear menu and

play19:27

once this is finished I can destroy the

play19:30

quick selection menu completely one

play19:39

thing you want to add here is you want

play19:42

to disable the collision for the trigger

play19:44

immediately if you close it down

play19:47

otherwise you may overlap one of the

play19:51

buttons so now let's do a quick test if

play19:55

everything is working

play20:01

so the other effect is working the

play20:04

states changed the way they should and

play20:06

I'm also getting the right tool or the

play20:09

gun here you may notice that my hand is

play20:12

rotated wrongly because I did a mistake

play20:16

in Maya so I fixed it

play20:18

and re-imported it again make sure that

play20:23

the socket is still in the right

play20:24

position

play20:37

so this seems right and now you can see

play20:40

it's nicely blending into the different

play20:43

positions here you have the effect is

play20:49

working and if I let go I have the tool

play20:55

in my hand okay so the next thing would

play21:02

be to actually give the gun some logic

play21:04

because right now it's just printing the

play21:06

strings let's open it up give it the

play21:13

right material because we don't want to

play21:16

have the ghost material in here I am

play21:19

creating an arrow this will be the

play21:21

location the projectile will be spawned

play21:24

so let's position it and in the event

play21:29

craft I want to get this position from

play21:31

the arrow and spawn my projectile at

play21:34

this exact position

play21:44

right now we don't have a projector so

play21:47

let's create it it's also just a very

play21:53

simple blueprint actor I use a sphere

play21:56

for the visual representation and scale

play22:00

it way down and I'm using the projectile

play22:07

movement component for the actual

play22:10

movement so in there I can just define

play22:13

an initial speed that's the speed of the

play22:17

projectile and you can also define

play22:22

things like do you want to have gravity

play22:25

on there so let's select projector we

play22:29

just created and hit compile and

play22:33

actually this is everything you need in

play22:36

order for the gun to work so now I can

play22:40

shoot

play22:44

let's open up the motion controller

play22:46

again and change the check at the

play22:50

beginning if we switch the tools to

play22:52

actually look for the active tool not

play22:55

only the gun itself so if there is an

play22:59

active tool regardless of what it is I

play23:01

want to destroy it first and after that

play23:05

is done I want to spawn my actual gun on

play23:08

my tool so this is it I think we are

play23:13

finished with the quick selection menu

play23:15

so far there are some things you can go

play23:18

in there and polish them up if you liked

play23:20

the video so far it would be awesome if

play23:22

you check out our patreon and support us

play23:25

that we are able to create another

play23:28

videos not only for the framework but

play23:30

also for unreal in general and it would

play23:33

also be very awesome if you hit the like

play23:35

and subscribe for this video so that way

play23:38

we know there's interest in this

play23:40

half-life to Alex serious thank you so

play23:43

much for watching and let me know in the

play23:45

comments what you want to see next

Rate This
★
★
★
★
★

5.0 / 5 (0 votes)

関連タグ
Unreal EngineVR開発クむックセレクトメニュヌ䜜りハムMERリングアニメヌションハンドメッシュプロゞェクトルモヌションコントロヌラヌアクティブツヌルパフォヌマンス