Creating a shooting range map, and need some help on the mechanical targets
So I'm working on a little side project for now, which is essentially a large-scale shooting range complex, complete with some killhouses. Work on the simpler things is going along smoothly, but then I hit a bit of a hitch.
I need some working mechanical popup targets.
Here's a current in-hammer example:
Mechanically, I need the target to do these things:
-When hit or taken damage, the target body should fall down 90 degrees backwards, with a hinge if possible at the base. This part has been the most difficult for me, since I just can't seem to find the correct axis so that it will fall down, and not just turn sideways.
-The targets should be able to be reset with a press of a button. If each target needs its own individual case (i.e. name, function, ect.), then I can use a logic_relay. I'd just like them to be able to be mass-reset at once.
-If possible, a nice sound emitter to indicate a hit would be a nice detail to have. Optional.
If you've got an idea on how this can work, or a working prefab, feel free to post.
The person who contributes the most/first working knowledge will definitely get credits if I chose to release the map or the target as a prefab.
Posted by birjolaxew
I believe a func_door_rotating could do the job. Set the origin at the point you want the hinge to be. Also check the flags.
That's the first thing that I thought as well, but I was trying to work with it, and it wouldn't work. For some reason, it'd always just turn sideways, or would spawn really weird.
Higgins, if you know what to do, it'd be appreciated if you could explain it.
Try either the "x axis" or "y axis" flags to get it to rotate downwards.
To get them all to reset you could have a button with the output OnPressed, func_door_rotating, Close as func_door_rotating will target all of them. You could also name them all with the same prefix (like target_1, target_2 etc) and set the target entity to target_* (* makes it a wildcard, so it'll target every entity with a name that starts with "target_").
For the sounds, use an ambient_generic. Depends how you've set this up but if it's like a shooting range where you stand in one place you could place it next to the player. Have each target have the output OnOpen, ambient_generic's name, PlaySound where "ambient_generic's name" is the name you gave the ambient generic.