Half-Life: Alyx Guide

How to make a button that spawns entities in HL:A hamer for Half-Life: Alyx

How to make a button that spawns entities in HL:A hamer

Overview

This guide will show you step by step on how to make working spawn buttons.THANKS TO ssj3fox (https://steamcommunity.com/id/ssj3fox/) ON DISCORD FOR THE HELPᴼʰ ᵃⁿᵈ ᵃˡˢᵒ ʲᵒᶦⁿ ᵗʰᵉ ʰˡᵃ ᵐᵒᵈᵈᶦⁿᵍ ʰᵘᵇ ᵒⁿ ᵈᶦˢᶜᵒʳᵈ https://discord.gg/t2HGEZu

Step 1

Make a box, this box will be your button.

Step 2

Select your box, and click
“Selected meshes to entities”, once this is done, name the entity func_button
go to spawnflags, check “touch activates”

Step 3 (Make the item you wanna spawn)

Then create the item you wanna spawn next to the func_button
give it a name! this will be important for step 4

Step 4 (point_template)

Make another entity, this time call it point_template (and give it a name in the “Name” key!)
in the key “template 1” put the spawned item’s name in it

Step 5 (env_entity_maker)

now make another entity called env_entity_maker (give it a name too)
in the key “point_template to spawn” enter the point_template’s name

Step 6

this step is very important,
go to func_button’s propreties and go to the output tab, create a new output, and enter this :

My Output Named : OnPressed
Target entities named : [your env_entity_maker’s name]
Via this input : ForceSpawn

Congratulations

if you have done all the steps right you should have a working button in your world!

SteamSolo.com