Are emissive/glowing fonts not possible?

hey friends, so i have run into a small issue, i wanted to make a speedometer for my car in my game and i thought how cool would it be if it glowed, so i threw together an emissive material and… well its invisible now

any ideas, or workarounds?

thanks

Hi, Could you screenshot the emissive material?

I don’t think UMG does emissive. I think you have to fake it like this

( but would love to hear otherwise ).

sure, its just a super basic emissive

i had thought of this too but i’d have to make my numbers into a sprite sheet and im afraid i dont know how to get actual numbers out of it for the speedometer to actually function.

You could make it a text render or widget component, that can be emissive, because it’s in the world ( so is your speedo BTW ):

You can just make a copy of the text material and make it emissive ( does not work with UMG )

how would i lock it to the ui if its 3d?

Ah, you want an on-screen speedo? ( not actually in the car in the world ).

Then you need to use the other method…

For this you make a flipbook out of your sprites for the numbers (from Zero to 9, then their indexes in the flipbook align with the actual sprite numbers).

Then in your widget, you create one image for each digit (a speed in the 100 range requires 3 images, speed of 1000 4 images for 4 numbers/digits :slight_smile: ), place them, where you want your speed to show up on your screen.

In the widget graph, You create a Flipbook variable and link it with your Numbers Flipbook.

Also create integer variables for all of your required digits, those will be used by your player/character to set the actual speed, and also to get the corresponding sprite from your flipbook to display it. I called them Digit001, Digit010 and Digit100.

And then the magic is just to get the sprite from your flipbook at a given index for each digit and make a brush out of this for your images in your Widget. I used a delay just to make it less sensitive, because the speed will usually be updated every frame, which can cause flicker in the display (in my case the engine calculated top speed between 499 and 500, constantly switching between those two values, creating a flickering display).

My complete graph for the widget, for a speed made out of 3 digits (max speed 999):

Then the messy part is in your character, where you have to get your current speed, break it up into it´s digits, transform those into integers, which you then cast to your Widget to your integer variables.

It´s a little bit messy, since there seems to not exist a function to break up integers into digits, so you have to build one.
I created an array of integers (SpeedDigitArray) containing 3 integers (max speed 999), where the speed will be written into. From this array i later get the integers and cast to the widget, to set the individual sprites for the digits in the Widget.

So you first need to transform your speed into a string. This string can then be converted into an array of all it´s characters (Get Character Array from String). To make life easier, reverse this array of strings - this makes casting to the Widget Digit variables less confusing.

Then loop through your SpeedDigitArray, and use its Array index to get the same Index from your StringArray (you should have a failsafe to make sure, that your String array is big enough, not that you access an index out of bound - i have a branch for that, comparing StringArray Lenght with the current index → if its bigger, then i set it to zero), write that into your SpeedDigitArray.

After the loop is complete, you can cast to the Widget, and finally get the integers from your SpeedDigitArray to set your variables in your Widget. Thats also the part where the reverse plays into, without the reverse the first index would be the 100 digit, or 1000, if you have higher speeds. With the reverse it starts with the 1 digit, second will be the 10 digit, third will be the 100 digit, etc.

The whole blueprint mess in one image, if the forum allows it:

Of course, the forum does not allow it ^.^ Link to Imgur, hopefully in full res.


How it can look like ingame:

Just an idea: what about trying to attach that text render component to your camera - this way you could make it appear like being fixed on screen. Drawback: it also could get hidden by world objects if doing that, so it depends on your setup, like camera on spring arm etc…

so far so good but im near the end of setup and mine doesnt have a target as an option too?

image

edit nvm i didnt drag off the right spot

Your speedometer variable is grey, it should be blue. Do you have the reference set at the “Event Begin Play”? In the big picture, top left corner, there at my “Begin play” where i create my widget, i also made it a variable, which i use down there at the end.

This part i mean:

The center part is where i set the variable for the casting to the widget.

Edit: Ok, turns out, you don´t even need to cast to the widget, if your variable is set correctly. (casting is one thing, i never really understand ^.^)

yea i ended up doing just that but sadly its just staying at 0
so idk what i did wrong

so just so you know my main issue is that i am attempting to add your stuff to this persons script, as i use a plugin for my cars SPEEDOMETER TUTORIAL (FOR AVS PLUGIN) - YouTube

One thing, that could happen, is that you don´t get the correct speed, or that you need to get the speed from a different actor, like your car, if your char is entering a car.

In my case, i get the speed from the Mannequinn/person, but your video shows his mannequinn is entering a car, which would be a different actor. So you probably would need to get the speed from your car (if that is not the actual player), and use that to set the Speed variable.

One way to test, if you get any speed is to make the Speed array and the Speed variable instance editable, so that you can see them in the editor.

i just had increased it to 4 digits, so that it can be over 9000, thats why there are now 4 integers in that array.

You can set this component to “Only Owner See”, so others will not be able to see it. You are right, this is a very hacky and lazy one.

1 Like

okay so i am really trying here, the original speedometer script was self contained in the speedo blueprint or as i called it 3d car for the 3d camera,
i rewrote your tutorial a few times now and am just getting nowhere who knew flipbooks were so hard :frowning:

here you can see the 2 brush setups you made, and the original speedometer script i am keeping next to it and have tried like 20 times to combine the two, heres the rest of your script, same blueprint

still trying to combine them but still getting absolutely nowhere sadly hopefully we can come up with something and you dont give up on me haha

i dont know if this helps but i found this function and told it to print and it seems to be accurate


image

I guuess, it´s easier to just pack a project with such a speedometer ^.^ So i took one of the UE5 default game projects, that one for Vehicles, and added that Widget to that.

Link: https://drive.google.com/file/d/14s8T-Qn_-aQeP0XmTA8d3wnidTpJxUN_/view

(why are UE5 projects always 300+ MB o.O , UE4 projects used to be just 10 MB or so )

In that project you have both the original Vehicle UI, and the Flipbook/Sprite based UI (Widget Speedometer in the new created folder “Widgets”).
If you now look into the VehiclePlayerController Blueprint (located in the VehicleTemplate folder), you will see the original stuff for the original UI (displays Speed and Gears on the left side), and my added stuff (displays Speed and Gears on the right side).

Now all you would have to do, is to link your Speed, that you get from your AVS Plugin, and connect that to the new stuff.

Probably this one:

I just wonder, why that part is in the Widget, and not in the Player Blueprint. Since my stuff and the original UI get their speed in the VehiclePlayer Blueprint, you probably should move that part to the VehiclePlayer too. Then use the output from this GetRotationSpeed Node to set the Speed variable.

Or just use whatever speed you can get ^.^

Video to show, how it should look:

Edit: Turns out, that i have this AVS Plugin too, so i connected the parts in the VehiclePlayerBlueprint the way i THINK, they should work. You have to do that IN YOUR project, where you have those AVS cars and the AVS Plugin. It´s not in the downloadable project integrated, because the cars there are not cars built for this AVS plugin. Just a screenshot.
Also i can´t test it, since i have no AVS car, and that plugin didn´t came with a functioning test level :confused:
So this squeezed in part is just guess working, might not work at all. It replaces where the speed is read from:

i could send you my project its mostly a fork of the avs test car

also i ended up making a much more accurate text speedo using the air velocity instead of wheel speed

edit

heres a link to the project, i did end up deleting the code and my speedometer artwork from the project because i pretty much gave up but theres a working speedometer and a pretty well tuned car to drive around in