[c++] Variable problems

Hi!
I cannot use a boolean variable from the code in blueprint. I set the input in c++. I have “IsAiming” bool variable which indicates, if the character is/isn’t aiming(right mouse button is pressed). I need this variable in the Animation Blueprint, AnimGraph: when it’s true, do the “aim” animation.
I’ve read about the UPROPERTY, but I still don’t know what means “Category”. What properties do I have to set, to be able to use it in the AnimGraph?
Thanks!

Hey !

I use a similar method with an int32. Set your variable up in c++ like this:

YourClass.h

/** Amount of Ammo */
	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = Ammo)
	int32 AmmoAmount;

Now in your blueprint, since this is coming from code you want to make sure to check Show inherited variables and your variable should be among those.

19825-c-to-bp_var.png

You’ll notice that the variable is under a fold out menu called Ammo because that is what Category is for in your code. It’s for organization. You can use quotes also if you wanted something like “GSB -|| AIM ||-”.

Thanks for the answer! But I found out, not that’s the problem. If I click on the right mouse button, will not happen anything. I tried to crouch (bIsCrouched is implemented), but no action happened. I’ve set the AnimGraph to be everything ok, but no action. The input settings are ok. Why doesn’t work?

I’ve resolved. I had 2 functions: StartAim and StopAim. The problem was, that both were on IE_Pressed…Anyway, thank for my main answer!