
Announcement
Collapse
No announcement yet.
Vehicle HUD change
Collapse
X
-
legacy-MarZer repliedEach HUD has a PawnOwner variable, which is always the pawn that the hud curently belongs to. Since Vehicles are pawns too, when you are in a vehicle, the PawnOwner is a vehicle. You can use this to change what is displayed on the hud, for example, an excerpt from HudCDeathmatch.uc:
Code:if ( Vehicle(PawnOwner) != None && Vehicle(PawnOwner).Driver != None ) { if (Vehicle(PawnOwner).bShowChargingBar) DrawVehicleChargeBar(C); RealPawnOwner = PawnOwner; PawnOwner = Vehicle(PawnOwner).Driver; }
Leave a comment:
-
legacy-PlayerPawn started a topic Vehicle HUD changeVehicle HUD change
What is the best method to change the HUD or display new things on the current HUD only when in a certain vehicle? (putting the code within that vehicle's class)Tags: None
Leave a comment: