Does anyone know why this cast could or does fail? I have used this method a tonne of times with no issues. I am having a similar issue with my get player controller cast to my player controller. I have another project where I do the exact same thing and it works!
Is there some fundamental thing that I am missing in this project compared to others?
The get player character node is a function that is linked to the parent class of the “Character” class. So the PlayerCharacterBase could well not be a “Character” class which would cause an issue, but it is a character. So the get player character node should be able to call the character I have made because it is of the character class.
It is also happening with the player controller which is of player controller class.
Both of which I have used several times in other projects and been successful.
So I tried the exact same thing in the Third person Example project and it works how I would expect it to work, so I am clearly doing something wrong in my project somewhere that none of my casts are working.
I just need to work out what is happening in the third person example that isn’t happening in mine.
Thanks, I already set up the Game instance in the project settings and set up the game mode while I was there, did this at the very beginning of the project before I started doing anything else.
Right, I have absolutely no idea what I did between last night and today, I deleted all my code, re-did all of may variables and it seems to work!?..after doing it in 2 other projects.
I have no idea what happened? Maybe the editor had a melt down I had been working in it for 12 hours straight.
Anyway, thanks to everyone who offered their help and advice, I wish I could tell you what solved the issue but I really have no clue at all, just re-opened the project re-did the casts and they worked.
Thanks for your time, no idea what happened but it seems to have resolved its self and allows me to use the exact same casts successfully now after a re-boot of the engine.