How do I call a method from Another Class?
Hey Community I had a quick question for you. I've got two classes, one Character(Default 3rd Person) and an Actor class that i've turned into a "pick-up" sort of item. I'd rather not use blueprints but I was wondering something...
How exactly would I call a function inside the character from the other actor class? I've already tried &AProjectX2Character::numSubtract;
However the function in the character class doesn't seem to be responding. I was wondering if you could offer abit of some friendly advice?
I'm guessing it isn't pointing to the correct spot but i'm not sure if that's true because there is only one instance of AProjectX2Character. (That I know of.)
Thanks a bunch!
(As requested Mr. Rama. :D)
Thanks Mike for requesting the code :)
You need to use the passed in Actor ptr and cast it to your custom class
if the cast passes you can access the functions on that particular instance of your character class
answered Jun 15 '14 at 05:51 AM
Post your code please. there's nothing special to do to call a function if you have the reference and the function is public. You can do that in either code or blueprints.
answered Jun 15 '14 at 04:54 AM
Follow this question
Once you sign in you will be able to subscribe for any updates here