Hi,
I’m getting a lot of warning when I’m editing my Vim Blueprint because of certain nodes trying to access the Character class :
[0564.65] LogScript:Warning: Accessed None 'CallFunc_GetPlayerCharacter_ReturnValue_CB4002454BC0445360F62597F1F15043'
vim_lena_C /Engine/Transient.DebugSkelMeshComponent_1:vim_lena_C_0
Function /Game/EXIL/char/char_lena/lena_anim/vim_lena.vim_lena_C:ExecuteUbergraph_vim_lena:0A29
[0564.66] LogScript:Warning: Accessed None
vim_lena_C /Engine/Transient.DebugSkelMeshComponent_1:vim_lena_C_0
Function /Game/EXIL/char/char_lena/lena_anim/vim_lena.vim_lena_C:ExecuteUbergraph_vim_lena:0A3D
[0564.66] LogScript:Warning: Accessed None 'CallFunc_GetPlayerCharacter_ReturnValue_367507284EC57F26F9022EAEBB97753B'
vim_lena_C /Engine/Transient.DebugSkelMeshComponent_1:vim_lena_C_0
Function /Game/EXIL/char/char_lena/lena_anim/vim_lena.vim_lena_C:ExecuteUbergraph_vim_lena:093E
No need to say this is really annoying and make the log file really hard to follow or even read. I’m getting this warning if I’m using the “Get Player Character” function, but also with my own blueprint functions such as :
FORCEINLINE class AEXILCharacter* UEXILVim::CastToCharacter(AActor* Input)
{
if(Input != NULL)
return Cast(Input);
else
return NULL;
}
The error is normal of course since the Character class only exists during the game, not in the editor. However I don’t see why this warning appears while calling “Get Owner Actor” doesn’t make a similar warning. Is there a way to disable this warning ?
Hi Fabrice,
You should be able to do a test on the output of your cast node. Something like the following:
That’s using the IsValid macro, but you can also use the object != node, with nothing connected to one of the pins.
Cheers,
Michael Noland
To clarify, the access none warnings comes whenever a null object is wired into a node as the Target pin. Wiring it into other pins won’t cause the warning (and in Beta4, even wiring it into the target pin won’t cause a warning by default unless the node has a return value).
The “cast to xxx” is not available in my current build. I guess it’s a bug that have been fixed.
Hi Fabrice,
That cast to specific thing was just a function I made in the BP, taking the place of the CastToCharacter you defined above. If AExilCharacter is a native class, I would expect it to show up already though as a casting target (my CastToCharacter function had a Cast ACharacter node inside of it).
Cheers,
Michael Noland
Ha, I didn’t experienced yet the making of functions inside blueprints. I will take a look.
However, my AEXILCharacter is a native class and doesn’t show up in the palette. I only have “Cast To PlayerController”.
Aha, That’s the issue. CastToPlayerController is actually a function. None of the casts show up in the palette, they’re only available as a context action when dragging a pin, so that it only shows casts that make sense for a given type.
Cheers,
Michael Noland
Wow, it’s more clear now ! I wouldn’t have expected something like this at all ! I guess I still need to learn a lot of things from blueprints. Thanks a lot !
Hey Fabrice,
You can disable warnings using #pragma warning(disable: (warning number) )
Best Regards,
Ryan
Unfortunately, I can’t disable the warning (I just tried) because the warning number increment by itself in the log window.