I am trying to wrap my head around casting, and nobody talks about this menu. I have seen pictures of people using it in older versions of unreal, but when I try to select an asset, the menu disappears and nothing happens. What is going wrong here?
pull get pawn from that
Think of a cast not as “I’m getting the thing” but as “I have the thing, and I need to make sure it’s what I think it is before I do anything with it”.
Like @DragonRelt mentioned, you need to pull off the node and get something from there. In this case, a pawn, character, or whatever else that ThirdPersonCharacter might be.
If this is a single player tutorial, it’s 99% most likely Get Pawn.
If your casting to game mode, then there is a get game mode node as well, then there is cast to game instance, and with that its get game instance. I would however recommend that you instead create a node within the game instance that allows you to grab the casted node without casting everythime, To obtain this create a blueprint interface do this
then promote a varabile to get game data which would look like this
and then you can get game instance then get game data every time without casting to game instance.
Hope it helps, this is also good as well because you can use this for a save system
So is that menu just broken?
Casting does not find an object for you, that’s your job. Where is the actor instance you want to cast?
In many cases this menu makes no sense to populate manually from a dropdown. Cast is a test
+ conversion
. You need a target instance to do so. Said instance does not exist because you’ve yet to run the game and spawn the instance of a character. There is no asset to select.
If that’s not the case, do explain what the current scenario is. What / when / how are you trying to cast. What are the circumstances?
No, it’s an input pin.
It wants you to provide an object for it to look at.
So you can’t just give it a class,
you need to give it a reference to an object that exist somewhere in your game-world.
My goal wasn’t necessarily to do anything in particular, I am just trying to better understand unreal. What I was trying to do was to find a way to take any variable from any blueprint and put it in another blueprint. I am aware that there are ways to do this specifically for the player, like so:
but I was looking for a single method to do this with any blueprint, I don’t think you can, though. What I thought you would be able to do is just use that menu to select the blueprint whos variable you wanted to access, but that probably isn’t how this works. All that aside, what is that menu for and what do I do to make it work? (In any situation, not just mine)
You have an issue with obtaining references, not with casting. Casting has nothing to do with finding references. You cast once you already have a reference. Focus on that part.
nobody talks about this menu. I have seen pictures of people using it in older versions of unreal, but when I try to select an asset, the menu disappears and nothing happens. What is going wrong here?
You’re seeing this dropdown here becase someone disconnected a pin that should not have been disconnected and the node defaults to a wildcard pin. Selecting anything there makes very little sense since objects generally do know about other objects’ existence - that’d be utter chaos and not the OOP way which BPs subscribe to.
What I was trying to do was to find a way to take any variable from any blueprint and put it in another blueprint. In many cases there would be no need to cast.
For this you need to know what those BP are, where they are, how they made it into the game and what logic you’re trying to achieve. There exists no one generic way of finding stuff - referencing and communication is circumstantial. No one method is better than others, some overlap in their utility and some are not suitable to certain tasks even though they can be made work.
If you have a concrete scenario / example and need advice, please do tell. You may have a situation where there is a doorBP
and a buttonBP
that opens it, both sitting in the scene - making them communicate is trivial and requires no casting whatsoever.
Some reading materials if you prefer to get to the bottom of it all on your own:
Actor Communication in Unreal Engine | Unreal Engine 5.5 Documentation | Epic Developer Community.
Check the links at the bottom of that page . And this is pretty good if you prefer someone talk at you in a soothing voice:
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.