Hey, for my user interface I’m using a system wich when I looking an item I writes in the user interface “(name of item) : press E to pickup”. I’m using a bind function of the text to do that but, in the blueprint, when I’m triying to cast to “GameplayController” ( a custom playercontroller) after a get player controller the cast fails. The return value of “get player controller” is the a “GameplayController” that is default playercontroller of my game. I would know why the cast fails.
Please show the code or a screenshot, impossible to say what the problem might be without seeing it.
Hmm, okay this isn’t enough still.
So from “Get Player Controller” drag out a Print String function and print the name. Then could you also provide a screenshot of your Game Mode settings in the Level, this will show which controller is setup:
Create a Blueprint of your GameplayController and set that as the Player Controller Class instead
That error means that the variable is null. To avoid the error you can use an Is Valid node in your BP. That way when it really doesn’t have a reference it will not throw an error.
How can I link an Is Valid Node with the rest
I’m a begginer with BP
actually this result is disturbing because it shouldn’t do that
[image]
I follow a tutorial and it’s supposed to display the name of the object I’m looking at on the user interface
Plug your CurrentInteractable object into the IsValid node like below.
You could create a local string variable, default to empty, if the Branch node is True, set the string variable before returning it.
Do you use a Trace to determine the object your are looking at? Your trace might be too short so your CurrentInteractable is not getting set because your trace doesn’t reach the object. Could be many other reason though.
I don’t know why but it doesn’t work :
Maybe the BP is badly made ?
(I just can talk with editing this message because I can’t reply during 22h)
Yes : Crafting/Inventory System Tutorial in Unreal Engine - #1 - YouTube
Do you have a link to the tutorial you used?
Could also try this to debug:
MultiLineTraceByChannel
Create a blueprint of InventoryChacter and set that as the default pawn in the game mode settings like you did for player controller.
It changed nothing to set a BP of InventoryCharacter as the default pawn and I already did the Trace by channel in c++