This article relates to the game "Half-Life: Alyx". Click here for more information.
This article relates to the workshop tools for "Half-Life: Alyx". Click here for more information.
This article's documentation is for Source 2. Click here for more information.

Кнопки

From Valve Developer Community
Jump to: navigation, search

English (en)русский (ru)中文 (zh)
... Icon-Important.png

Введение

Из этой статьи вы узнаете, как создавать кнопки на примере HL:A

Настройка

Создайте тестовую комнату. Установите объект prop_dynamic. Затем установите для него модель: models/props/button_1_pusher.vmdl в параметре World Model.

HLA SDK Buttons Img1.png

Установите браш-объект: func_physical_button. Сделайте его по размерам как объект(модель) prop_dynamic, и установите для него следующие свойства:

Key Value
Name button_pusher
Move direction <align it with the push direction>
Speed 10
Delay Before Reset 0
Use sound Button_Basic.Press

HLA SDK Buttons Img2.png

В Output объекта func_physical_button добавьте следующее:

My Output Target Entity Target Input Parameter Delay
OnPressed <targetEntity> <input> 0.00

Снова выберите prop_dynamic и установите параметр Parent Name как button_pusher.

Завершение

Скомпилируйте и запустите вашу карту. У вас должна быть рабочая кнопка.