Score integer not showing?

Hello everyone. For some reason when I create Score integer it’s not showing up in other functions like Game mode, Blue print, Game instance. I put Score integer in Game Instance, Game mode, Level Blue print and open the eye icon as well but it’s not showing in other function only in the one that Score integer was created. I made one in blue print and it’s only showing there not anywhere else. I compile and restart the whole project and still won’t show up in other modules.I would usually create Score integer and then wont be able to create another one under the same name and now I have like 3 Score integers under the same name and no problem. lol. Help. These whole thing is a bit confusing. Thank you!!!

a variable only exists in the actor it was created in. This means that if you want to get the score variable in multiple actors then you will need to get a reference to the one that contains the variable. lets think of it another way if it were a health value and you had 3 different people they wouldnt have the same health value right, and if you were comparing a human, a chair, and a rock then chair and rock probably wouldnt have health values right.

so on to the solution, for your case since its a score value i would have the score stored in either the game instance or the game mode bp. for the following example the situation im going to use is that you have the score value stored in the game mode and you want to use it in the level bp. to do this you would first create the variable in the game mode bp, next open the level bp right cliuck the graph and search for get game mode and click it. now drag off the get game mode node and search for “cast to (insert your game mode name here)”. what the cast does is it takes the input and compares it to the object type you specified, in this case the game mode type ( this is just a fancy way to say it identifies it by its type). now that we have a reference to the game mode and know its type we can take the object out pin on the cast, drag off, and search for the variable we created earlier. this will provide the score variable from the game mode, its value and all.

For some reason when I create Score
integer it’s not showing up in other
functions like Game mode, Blue print,
Game instance. I put Score integer in
Game Instance, Game mode, Level Blue
print and open the eye icon as well
but it’s not showing in other function
only in the one that Score integer was
created. I made one in blue print and
it’s only showing there not anywhere
else.

By functions you must mean blueprints. And no, it will not show - that’s how it’s supposed to work. The framework classes you mentioned are available everywhere and access to this variable is only one Cast away (ehm, always wanted to say that :slight_smile:

Keep it in the Game Mode and whenever you need to access it, GetGameMode → Cast To (your game mode) > Get your variable

Thank you for helping out. In my case I set Score integer + integer and it’s counting and showing fine with print string inside the Level BP. Now that I go to my widget Text and click text binding option and make a text as a variable for some reason I don’t see the Score integer I just made. Would be easy from there on to converted to text. That should work but it doesn’t for some reason.

Also I did what you guy suggested but I got everything working with above example and my example with adding score just fine (print string) how ever when It’s time to converted to text in my widget with binding option then no Score integer is showing up. I can’t get it or set it cause nothing in variable section.

two things here first if you want to access the score value in your widget then you will need to do the same operation again to get a reference to it. you can see an example of that in this other post. the second thing are you setting the variables value again once youve done the addition? it doesnt really say and i want to prevent issues before they arise.

If i connect print string right after SET it works grate. It adds score correctly but if I connected like you see above then it prints out 0 all the time. So when I play the game the TEXT constantly showing 0. Why is it not adding. Inside the My_gamemode I have Score Master integer. Shouldn’t what ever is collected integer + integer inside BP be send to My_gamemode Score master integer variable? Maybe I need some kinda function inside the My_gamemode it self?? Cause inside all I have is Score master Integer variable.

Also these is basic code project and the Sphere actor is what triggering the box trigger. I think the problem is in there.

what your showing in your picture is two different variables for score. as it is two different variables they dont affect one another. just because you name two variables the same that doesnt mean they are connected in anyway they are very separate. what you want to be doing is getting the score from the game mode and adding to that score then setting that value. so delete everything between your event and the cast (get score, +, and set score), then connect the exe pin from the event to the cast. now from the score master drag off and add a + node, then drag off the as my game mode pin on the cast and search for set score master and connect it to the return int pin on the + node. lastly connect the set node to the print string.

Everynone. Could you see my question on my page. I really need some Pro. help here. with strange problem. Thank you!!

You’ve got 73 questions there.