Object reference cannot be connected to anything in the HUD, how should I make my blueprint to function properly?

This is my hood to print the points based on the integer but I don#t know what I have to connect to the object in BP Motion Controller. In third person game mode it is game mode. It’s in virtual reality.
Player controller,
player pawn,
motion controller,
also didnt work!
what should I do?

You need to get a refrence to the object, either by “Get All Actors of Class” if the actor is in the world. You can get do a “Get” off the array pin of the “Get All Actors of Class”.

Or you can create an interface or dispatcher on the “BP_Motion_Controller”.

EDIT: Or create a refrence to the hud in the controller and run your logic in the controller. Try not to use bindings in UI elements as they rtun on tick even when you do not require them to be running.

Or you can “Get player controller” and cast that way

All depends on what your controller is for…

the bp_motionController is an actor that represents one hand, its not a place where i would be storing your score variable. a better place to store the score would be in the player pawn or in the gamemode, also as a bonus those two places are much easier to reference as well.

i imagine your current setup is something like motioncontroller overlaps or grabs certain item add score. if thats the case then you would simply need to just change it to on overlap get player pawn cast to “classX” then get the score variable stored in that class and add to it. storing the score in the game mode is basically the same operation.

i would make an example to show how its done but i dont have any motion controllers right now to test with.

So now the problem is solved i did it in game mode and boom everything is working properly, I have another question. The player can either directly hit the objects that it should collect or grab and throw a box to them. How can i make the final score to be the sum of these two ways. Right now only the ones that the player hit directly are printed on the screen.

So now the problem is solved i did it in game mode and boom everything is working properly, I have another question. The player can either directly hit the objects that it should collect or grab and throw a box to them. How can i make the final score to be the sum of these two ways. Right now only the ones that the player hit directly are printed on the screen.

thank you i did it with the game mode thing but now the problem is solved i did it in game mode and boom everything is working properly, I have another question. The player can either directly hit the objects that it should collect or grab and throw a box to them. How can i make the final score to be the sum of these two ways. Right now only the ones that the player hit directly are printed on the screen.

you just need to script a way to add score on both conditions. so basically on both your motion controller and your box you would have a hit event that checks the other actor and if its of the right class you add score (get game mode, cast to, get score, add X, set score)

or you could just have in the item thats hit to get score a single on hit event.

its kinds hard to say exactly what to do without context.

So here are the things ive got. It does not show the sum of the two types
what am i doing wrong?

Dear Thompson I have posted the 4 photos, below, could you please check them out

in the first picture you dont really need to have two parameter inputs for your event they are both doing the same thing.

in picture two and three you need to be doing the cast and calling the add target points event before you destroy the actor, otherwise the the cast and event will not be called due to the actor being destroyed first.

aside from that it looks good and should work without issue based on whats shown here.

Can I see what you did, I’m having the exact same problem as you, I can’t print the score into the UI :frowning: