Hello, i'm trying to make the Spacebar, when pressed to pan the camera at the location of the triggering players Hero. Since there is no event a "A player presses the spacebar", i came out with something like this:
1. Will it be a problem if this trigger runs through the entire game?
2. How to delete the location for SpacePoint[(Player number of (Owner of (Picked unit)))]?[/trigger]
-
Spacebar Camera
-
Events
-
Time - Every 0.03 seconds of game time
-
-
Conditions
-
Actions
-
Set SpaceUnitGroup = (Units in (Entire map) matching ((((Matching unit) is A Hero) Equal to True) and ((((Matching unit) is hidden) Equal to False) and (((Owner of (Matching unit)) controller) Equal to User))))
-
Unit Group - Pick every unit in SpaceUnitGroup and do (Actions)
-
Loop - Actions
-
Set SpacePoint[(Player number of (Owner of (Picked unit)))] = (Position of (Picked unit))
-
Camera - Set a spacebar-point for (Owner of (Picked unit)) at SpacePoint[(Player number of (Owner of (Picked unit)))]
-
-
-
Custom script: call DestroyGroup(udg_SpaceUnitGroup)
-
-
1. Will it be a problem if this trigger runs through the entire game?
2. How to delete the location for SpacePoint[(Player number of (Owner of (Picked unit)))]?[/trigger]
Last edited: