Cast Actor Component (SOLVED!)

Hello once again

im having a problem with UE 5.2 and Casting to Actor Component’s

because my FPS shooting function is setup in the Default BP_weapon_Component set by the UE developers

i have this problem that i cant seem to find the rught object cast to i can call a boolien in the actor for my animations

here are some screenshots

The issue youre going to have with this is that the weapon component isnt available all the time for the character only after you pick up the weapon. That said you would drag off from FP Character and get components of class, select the weapon class that should give you access to your boolean.

hmm it kinda worked because no casting problems

other then when i try it this way the animation plays when not shooting and when shooting
so tryed a branchso if true then play if not dont play but didnt work eather way

plus this error

also my weapon is not on pickup i changed it so it gets attacted to the player on start

Blueprint Runtime Error: “Accessed None trying to read property CallFunc_GetComponentByClass_ReturnValue”. Node: Set CanShoot Graph: EventGraph Function: Execute Ubergraph P1 Anim Blueprint: P1_Anim

If your weapon is there all the time you can access your weapons component directly through your character via its name. You’ll need to check the weapon component reference for validity, it says error but as you said that component it always attached it should always find it. Its always a good idea to check your references for validity especially when not casting :sunglasses:

oke so let me explain its only attached when the game starts
if the pickup actor is placed in the world

so by fefault Ue 5.2 has it on pickup

so all that i changed was this because i hated the way the did it

i know its a complicated mess

because all basic FPS functions are now speard over 3 actors

BP_firstPersonCharacter
BP_Pickup_rifle
BP_Weapon_Component

here is a screanshot of the pickup actor

okey its funny i got the animation working now but still get this error

here are 2 screenshots on how i made it work

Blueprint Runtime Error: “Accessed None trying to read property CallFunc_GetComponentByClass_ReturnValue”. Node: Set CanShoot Graph: EventGraph Function: Execute Ubergraph P1 Anim Blueprint: P1_Anim



EDIT:

i did some changes and now its working like it shut execped the error is still there
that is the only one i cant seem to fix