Problem with casting to a blueprint
So I'm trying to cast to a blueprint called myCharacter. Within that blueprint, I have a variable called marker1Exists.
I'm trying to write the number '1' with my HUD, if marker1exists.
However, the moment I test this and hit the play button, I get 'Cast Failed' continuously appear. Am I doing something wrong?
asked Dec 09 '14 at 02:03 AM in Blueprint Scripting
Maybe i don't understand from which variable you want to cast to MyCharacter, but try: Right click -> Get Player Character >>> Cast to MyCharacter (so instead of "Casted My Character" node you'll have "Get Player Character") Sorry if i'm unclear, it's late here :) Good night.
answered Dec 09 '14 at 02:10 AM
As the previous poster said, you must make sure that 'Casted Character' references a valid Character. It should point to an instance of MyCharcter or one of its sub-classes. If your aim to to get a reference to your-own player, then use GetPlayerCharacter node as @Slavq sugested.
answered Dec 09 '14 at 03:04 AM
Follow this question
Once you sign in you will be able to subscribe for any updates here