Hey all 
I am trying to create health bars with other information like player names above players heads.
Now I basically have this working except the scaleform movie clip isn't lining up correctly enough.
How it looks is that when you are very close to another player, it lines up at roughly half the players height, and too far to the right. So I figured if I just adjusted the X & Y values this would solve the problem.
It did, but only if you are standing right next to the player. As you get further and further away from the player, the health bar location becomes more and more wrong.
This is my code for attaching the the MC to the player:
My Hudwrapper class:
and this is the actual movieclip class:
and finally, I am creating the movieclip inside the vehicle that the player is in
I am thinking that maybe the origin of my swf is wrong perhaps, or maybe I am just going about this the wrong way.
Any suggestions would be most helpful!
Thankyou!

I am trying to create health bars with other information like player names above players heads.
Now I basically have this working except the scaleform movie clip isn't lining up correctly enough.
How it looks is that when you are very close to another player, it lines up at roughly half the players height, and too far to the right. So I figured if I just adjusted the X & Y values this would solve the problem.
It did, but only if you are standing right next to the player. As you get further and further away from the player, the health bar location becomes more and more wrong.
This is my code for attaching the the MC to the player:
My Hudwrapper class:
Code:
event PostRender() { local PHVehicle Beacon; local vector loc; super.PostRender(); foreach WorldInfo.AllActors(class'PHVehicle',Beacon ) { if (Beacon.HealthBeacon != none && WorldInfo.GRI.OnSameTeam(PlayerOwner, Beacon) == true && Beacon.Controller != PlayerOwner ) { loc = Canvas.Project(Beacon.Location); //loc.Y += -300; // loc.X += -100; Beacon.HealthBeacon.UpdatePosition(Beacon,loc); } } }
Code:
class PHGFxHUD_Beacons extends GFxMoviePlayer; var int Width, Height; var string UserName; var GFxObject PlayerName_TF, HealthBarMC; function bool Start(optional bool StartPaused = false) { local float x0, y0, x1, y1; local PlayerReplicationInfo PRI; local PlayerController PC; super.Start(); Advance(0); self.SetViewPort(10000000,100000000,10,10); // Get width & height of Movie GetVisibleFrameRect(x0, y0, x1, y1); Width = x1-x0; Height = y1-y0; PC = GetPC(); PRI = PC.PlayerReplicationInfo; UserName = PRI.PlayerName; PlayerName_TF = GetVariableObject("_root.UserName"); PlayerName_TF.setText(UserName); HealthBarMC = GetVariableObject( "_root.HealthBar" ); return true; } function UpdatePosition(PHVehicle o, Vector ScreenPos) { self.SetViewPort(ScreenPos.X,ScreenPos.Y,Width,Height); } DefaultProperties { bDisplayWithHudOff=false MovieInfo=SwfMovie'PHHUD.HealthBeacon' bAutoPlay = true bCloseOnLevelChange = true }
Code:
class PHVehicle extends UTVehicle; var PHGFxHUD_Beacons HealthBeacon; simulated function CreateMovie() { HealthBeacon = new class'PHGFxHUD_Beacons'; HealthBeacon.MovieInfo = SwfMovie'PHHUD.HealthBeacon'; HealthBeacon.SetTimingMode(TM_Real); HealthBeacon.Start(); } simulated function PostBeginPlay() { Super.PostBeginPlay(); CreateMovie(); }
Any suggestions would be most helpful!

Thankyou!
Comment