hi everyone I am trying to cast to my “player character” to get a variable called “has enough currency” for a shop I am making but the cast to player character always and I mean always fails and I can’t understand why.
screen shot 1 is of the cast to player character node
screenshot 1:
I may be misunderstanding your question. You know how to spawn things in general right? Spawn Actor of Class node? That takes in a Location parameter that tells it where the new actor should appear in the world.
You would have to use something like “Get All Actors Of Class” which will return an array of all spawners located in the level, so if you have multiple this will be an issue. If you are doing this within a level BP you can easily create a reference to any actor including your spawner by selecting it in the viewport and opening the level BP, right clicking in the event graph and search for “create reference to selected actors”. But you need to get a reference to the spawner somehow to be able to get it’s location.
Looking at the blueprint, i see nothing wrong with that. The issue has to be somewhere else. Are you 100% sure that’s the exact class for the current player? Maybe you’re using a different one (like a stock 3rd person one, or another class you made besides Player_character). One way to check would be to do this :