Blueprint seems to ignore values

UFUNCTION(BlueprintCallable, BlueprintImplementableEvent, Category = “Roll”)
void Attack_NoUser(const TScriptInterface& target, float modifier, EDefenses defense, bool& result);

UFUNCTION(BlueprintCallable, BlueprintImplementableEvent, Category = "Roll")
	void MeleeAttack(const TScriptInterface<ITargetableInterface>& target, class ATWUCharacter* user, EDefenses defense, bool& result);

Attack_NoUser seems to be losing the Result value. In testing, I have seen a False become True, a True become False, a False remain False, and a True remain True. Yes, the inputs are being ignored; I removed their logic in trying to find the source of the problem.

Hi NullBlack,

I’m a bit confused. The way you have this set up it will choose a random boolean value to print every time you run Melee Attack. As such, you cannot rely on previous data to determine what type of boolean value you are going to get. Are you trying to determine a hit/do not hit that is determined by “Attack No User”? If so, I would recommend utilizing something more reliable than a randomized pass-fail system. Perhaps a percentile system? Do a random int in range from 0-100. If the int chosen is less than, for example, 60, return a false value, which will represent a failed hit. If it returns greater than or equal to 60, return true, or a positive hit.

…You’ve missed the point of my post and somehow still pointed me to the problem: the random bool in A_NU is reevaluated (and rerandomized) with each use (ie the print and the return). I needed to use a local variable.

I need to store the random variable in a local variable; attaching the random generator node to the print and return nodes just causes it to reevaluate for each.

Well, I’m happy to hear you found a solution to your problem! I’m going to go ahead and mark this as answered, if you need further help feel free to comment again, it will re-open the question.