FYI, I believe the isValid check on the GetWidget call is redundant. Sending a nullptr into the cast will fail the cast. Probably can just put the SetTimerByFunctionName on the failed cast.
Great tutorial, amazing work. I have done this tutorial plus the 4 parts of the lobby steam but I'm using the steam name, I want to hide this widget and show it only inside the map where they play. I made it hidden visibility but in which blueprint should i add the show
Add a delay brother ... If your logic is ok this can solve it. You can try to get a variable in your pawn and update the overhead widget on every tick with that string. If you need a delay everything will work if widgets updates on tick, if not. there is a logic error.
So you want to make a player tag for a Steam game ? You tried the approach where on the BeginPlay > if locally controlled > get controller > get state > player name > set player name on server so it rep notifies, but ... It gives errors. Idk why. Add delay of 5 sec. Now it works. God dammit unreal, really ? really ?
you are the best. you deserve 100K likes and views. I was going to ask if you can help on creating a main menu screen and everything because I think you're the only person that can do it the best. :)
They usually make a menu screen where you can start the game but it's never dynamic. Like where should the character start exactly? Or when you're at the main menu. The background is just a picture not a dynamic scene.
@@tamerdrop Yes that's a good idea for a tutorial. Like a main menu where you can open different pages (settings, credits, ...) and invite friends to a party and then start playing from a map that you can choose in the main menu?
Attach the widget component to a spring arm. Turn of the spring arm Do Collision Test and set Inherit Ptich, Yaw, Roll to false. The target arm length you can set to 0 or to whatever you want.
@NiceShadow Thanks for the answer, but I already fixed it by creating a new actor just for the widget and updating its position to match the players position on tick. Which approach do you think is better?
I have one theoretical question. In my game I have a team system where you can start a team and invite nearby players. I only want these nametags to be shown for players that are on your team. I have a variable that is an array that stores a reference of each teammate. I know I can use that array to hide/show the nametags accordingly, just not sure how to replicate this properly. Hoping someone has a good idea, and hoping I don't have to add a bunch of logic on the tick event?
Really helpful and awesome tutorial, although i have a question. How do you make the widget above player's head not change scale when the player gets away?
Thank you! If you click on the widget component you can set Space to Screen instead of World. Then you also don't need to make the widget component face the camera on tick anymore. But if it is set to Screen it also renders through walls.
@@NiceShadow and is there also a way to keep the widget above the player's head when the character gets respawned? because it doesn't attach to the player again after the respawn. the destroy actor function destroys the player together with the widget, but the respawn only respawns the player and the mesh but not the overhead widget
@@NiceShadow yeah it is, it stays when the third person actor turned into a ragdoll before respawn, and even after respawning it's at the ragdoll's location instead of the freshly respawned player. If using destroy actor, the widget gets destroyed together with the ragdolized character and doesn't show up anymore after the respawn.
Hey, I also implemented this method in my game i.e. using the game instance for storing the name and calling a repnotify on server. The problem with this method is that you can't hide the widget if you want to show the name whenever another character gets close or not because the name tag widget exists on the server.. I'm not sure how you would get around this.
It exists locally for every player. You can set a timer (Looped) on event begin play in the character. Then you can get the actor location of this character (self) and the actor location of get player pawn where you can get the distance between these two locations. Depending if the distance is bigger as a certain value you set the visibility of the name tag widget. The widget component itself has nothing to do with replication, it's just there because you added it by default to the character. Only the name value within the widget is replicated but this has nothing do regarding adjusting the visibility of the widget component.
@@NiceShadow is it too expensive? if i just set Collision ,it just can be enabled only for character whatever you want anyway and then when the other character is overlap with it then pop up the widget
@@leejames-f4z It's ok to do it so. But I would suggest that you constantly (for example with a timer that you set on event begin play) get the actor location (self) and do a distance node from that to get player pawn -> get actorlocation. And if the distance is bigger than a specific value it hides otherwise pops up.
if I remove the branch of check is locally controlled in set up local, it seems to be working, and using my steam name as well, otherwise it shows my pc name. is this a correct way?
Hello, the tutorial is genail and it works, but I have a problem, I am creating a game with a lobby and the new players do not see the name of those who are already in session and the players who are already in session do see the correct name of New players, any advice to fix that? thanks for the tutorial
Thanks, I considered that already when creating this system. The repnotify function should trigger for new joining players so I don't know why it's not working... Maybe you missed a step
@@NiceShadow Thank you very much for responding, what happens to me is very strange, in the same onrep I put the name in the widget and in a text render and in the text render it works fine for everyone at all times... something strange about my character again thanks for the tutorial, greetings
You can do that too. But screen space widgets render through walls and have always the same scale. For example if there are 2 characters nect to each other but 200m away from you, the name tags would overlap. To prevent that the nametag could be only made visible in a near distance. So both ways have pros and cons 😄
Maybe try in your game instance to set the name variable based on your api result. So instead to set the name of the editable text box in the main menu