What you doing is making subclass of MyCharacter, ofcose it gonna inherent all of it components. If you want to access this variable from unrelated class, you can get possessed MyCharacter with “Get Player Character” node, then you cast it to MyCharacter and get varable
Hi everyone!
I have some problem, so I would like to take a variable in my character blueprint, so I have take my variable and I see now the green eye like you can se in the picture
So my variable “MyWalkSpeedaa” is visible. Now I make another blueprint where I need this variable, so I make a new Blueprint Actor and now, I click on the Blueprint Proprieties and in the Parent Class I choose “MyCharacter” because I want to take the “MywalkSpeedaa”
http://image…com//2014/30/1406229173-bug.png
Ok so, everything is good but in this screenshot, I have all of my class in my new Blueprint that’s good but I don’t want to have the character, the camera, I just want this variable, nothing else. And I can’t delete this.
So, how can I get ONLY the variable that I want?
Thanks you very mush to help me!
The child will always get what the parent has, that’s how inheritance works.
Yes but what I want to do is to create with this new Blueprint a powerup who can up the speed of the character. And for that, I need to take this variable.
So I can’t take this. Maybe there is another solution?
Thanks .
Hi ,
Thanks to help me! Is it what you said?[alt text][1]
I’m not sure if I have understand, so if it’s yes, this is not what I want. The variable “Walk Speed” is a variable by default on the character, but I have make my own variable that I want take in another blueprint.
Thanks you.
[1]:
There are multiple ways you can do this. I assume your powerup is something the player touches and it activates, like a pickup? (health, ammo, etc)
When the powerup has an OnOverlap or OnHit event, cast the Other Actor to your player pawn. If successful, you will have access to all public properties of the player. Including your variable.
You may also want to look into Blueprint Interfaces, which is a way to send messages to other actors.
First of all blueprint is a class, it a “blueprint” of how object should look like, so you not communicating with blueprint, you communicating with object. You need to cast to your class/blueprint, because that node return Character object which doesn’t have your variable, in order for cod to identify that Character as MyCharacter you need to use cast o hat type. Grab link from "Get Player Character " and relese it on empty space and then type in “Cast” you should have all cast options shown.
Also dont post Comments as extra Anwsers, use comments as we did
Ok thanks you, this is working