Download

UMG Slider Radar

Hello,

Im making a racer style game and I wanted to have a radar kinda like the way older style of “slider” radar.

IE:

Theres a slider bar with little icons for each character, and the end point of the slider says finished. The icons only need to move along one axis, and no fancy maps for them to follow. I’ve just setup a slider for each character, and determined visibility by if they join (This works great). As each character moves towards the end of the level (As the game is 2D, all character move along the X axis to get to the end) the icons get closer to the finished label.

I’ve been playing with this for a while, and I can get the slider to work for 1 character(The same character that owns the HUD is the only slider that works, which shows me that its only getting the clients), but as this is a multi-player game, I need the rest to do the same.

Ive tried setting this up a few different ways in blueprint but can never get it to work. It always just defaults to 0.0 for the slider value.

Ive tried GetOwningController -> GetCharacter > GetActorLocation > BreakVector -> X (its 2d so can only move on x and z values) and did some math based on the LevelEnd vector var in my level blueprint. This works, but obviously just for the owning player. I also tried with GetPlayer and specifying indexes, but this runs into the client issue again, as it orders the player controllers differently on each clients copy of the array. So on client one the array might have it as PC1, PC2, PC3, PC4. But on player four, it sets it as PC4,PC1,PC2,PC3. So obviously hard coding indexes doesn’t work. I even tried setting a tag for each player controller and character, and using a four each loop, but both didn’t give me references, and the editor spat out warnings on play.

If I could do this in C++ ,I would much much much rather do so, as I am way more versed on the UE4 C++ side, but UMG is pretty steadfast on blueprints, so I’m running into issues with getting the correct references to objects in the game, as it keeps just getting local copies, instead of authority.

I’m starting to think I’ll have to keep track of the Loc.X’s server side C++ wise in the tick (Or just on character movement, save some resources), then just expose those vars to BP for the HUD. But I’d like to learn more Blueprints, so was looking to hopefully get pointed in the right direction.