Game Development Community

Ammo/Health Trigger

by none · in Torque Game Engine · 06/05/2011 (9:15 am) · 1 replies

Hi everyone! I've made an ammo/health stockpile and I'd like to add a trigger that when a player stands next to it, he receives lets say 30 rounds of ammo for all of his guns every 3 seconds along with 15 health points in the same interval. I know how to create the trigger itself but I need assistance with the scripts that would give the player ammo/health. Thanks for the help!

#1
06/05/2011 (9:22 am)
Use the "tick" of the trigger from a 3000m/s trigger datablock to iterate through the objects inside the trigger and test that the object is a player and increase it's inventory ammo and health. Look at the onTick info in trigger.cs.