- Joined
- Jul 21, 2015
- Messages
- 143
How do I remove and null a unit variable that is already set in the game?
I also want to be able to reset the player variable and remove the leak in that, I am not able to find the correct names for these variables
Unit Variable name: Name_of_Unit_in_Var
Player Variable for Camera name: PlayerVar
FixAngleCamera
Events
Time - Every 0.10 seconds of game time
Conditions
none
Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Name_of_Unit_in_Var is alive) Equal to False
Then - Actions
Camera - Reset camera for PlayerVar to standard game-view over 1.00 seconds
Camera - Stop swaying/shaking the camera for PlayerVar
Custom script: set PlayerVar = null
Custom script: call RemoveUnit( Name_of_Unit_in_Var )
Custom script: set Name_of_Unit_in_Var = null
Trigger - Turn off (This trigger)
Else - Actions
Camera - Set PlayerVar's camera Distance to target to 800.00 over 2.00 seconds
Camera - Set PlayerVar's camera Angle of attack to 320.00 over 2.00 seconds
Camera - Set PlayerVar's camera Rotation to 270.00 over 2.00 seconds
Camera - Set PlayerVar's camera Field of view to 90.00 over 2.00 seconds
I also want to be able to reset the player variable and remove the leak in that, I am not able to find the correct names for these variables
Unit Variable name: Name_of_Unit_in_Var
Player Variable for Camera name: PlayerVar
FixAngleCamera
Events
Time - Every 0.10 seconds of game time
Conditions
none
Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Name_of_Unit_in_Var is alive) Equal to False
Then - Actions
Camera - Reset camera for PlayerVar to standard game-view over 1.00 seconds
Camera - Stop swaying/shaking the camera for PlayerVar
Custom script: set PlayerVar = null
Custom script: call RemoveUnit( Name_of_Unit_in_Var )
Custom script: set Name_of_Unit_in_Var = null
Trigger - Turn off (This trigger)
Else - Actions
Camera - Set PlayerVar's camera Distance to target to 800.00 over 2.00 seconds
Camera - Set PlayerVar's camera Angle of attack to 320.00 over 2.00 seconds
Camera - Set PlayerVar's camera Rotation to 270.00 over 2.00 seconds
Camera - Set PlayerVar's camera Field of view to 90.00 over 2.00 seconds