Cannot Call Function After Cast C++
Hello All! I am currently trying to call a function after casting to my PlayerController class from my Character. Here is my code: The Character cpp:
Everything works fine until I get to the point of adding:
where I get the error:
Here is the code from my PlayerController:
Thanks for any help.
asked Nov 20 '17 at 07:27 PM in C++ Programming
If you are casting in your Character class, your first line is wrong. You are trying to cast your character class, not your controller class there. Just put Controller instead of this in the argument for cast in the first line. So do this:
That should work.
I don't know what exactly is the problem, but I'd change two things and if the error is not gone, post here again:
I did not know this could compile. You are asking if the address of the pointer APC is true. That is always true. Make this
or even better, give your pointers a "p" and use the complete question:
This is static:
If you really want it to be static, then you don't need a pointer and no casting, just use
in your code. But I don't think it should be static at all. I am not sure, I just think it should not be static.
answered Nov 21 '17 at 10:07 AM
Ok. Without changing anything except what I mentioned in the comment to the other answer; it is now working. I have no idea how, it just is. I restarted VS and installed VAX. Honestly; I have no idea why its now working.
answered Nov 21 '17 at 05:34 PM
Follow this question
Once you sign in you will be able to subscribe for any updates here