Accessed none trying to read property

As the title says, I get this error on runtime (it compiles) however, I’ve looked at everything and I cannot spot the issue. Here’s a few pictures.

Error:
alt text

References for CharMovement and where it gets initialized.

Where the error points to

The custom Initialize event is hooked to EventBeginPlay in the character blueprint.

I believe it is. Here is a picture. Also, I was following a guide on Avanced Locomotion System V4 (I am not familiar with it) and that is how he did it, for him it worked.

Where are you calling Initialize? Is it valid there?

No idea, in fact. It is possible to pass the CM as a param.

All I can tell you is that error is never wrong, and you have to work back and figure out what’s going on.

It’s possibly a timing problem if you’re calling it on begin play. You might to wait a short while before using it.

It does. I setup a print string to check and it printed out “Initialized”. Also, I think I may know what the issue is, potentially. At the start of the project, I was fiddling with moving files around and ended up accidentally moving the wrong folder (the folder that has ALSV4 and all the components in it).

Long story short I ended up with two folders and twice of everything… could that be the problem? It’s simply getting confused. Cause I have two ALS_Base_CharacterBP.

Thanks. I will rewatch the video and work my way back. Oddly the BPCombat and Mesh all work fine. It’s just the movement that doesn’t.

Try setting it slightly after begin play…

Can I just put a delay node between it and begin play?

Set it right off the bat, but have a delay before you try and read it ( .2 is fine ).

I’ve done some more debugging. So setting CharMovement on begin play does work, it prints out. The issue happens in the IgnoreRootMotion function. That function gets called every time I press attack. It’s suppose to turn off root motion during the attack and basically rotate your character towards where you want to attack every time you attack.

The function gets called properly, but nothing gets executed pass the branch check. For some reason it just doesn’t see/access the CharMovement.

I also tried a small delay but results were the same.

I think you’re missing it. The BP_Combat BP never has a value for the character movement, that’s why it doesn’t work.

Does the combat bp exist when you call the initialize?

Is the print string in the combat BP?

I’m not sure about the duplicates, you might need to migrate stuff to a new project.

Yeah. I’ve put it in the event graph, right after it Initializes via custom event.

I will try making a fresh new project today and do it all from scratch. Will take some time, but I am pretty baffled why is it not doing what it’s supposed to do. Everything seems in order.

Just a quick update. I remade the project from scratch, keeping everything at default and just redoing everything up to the point and it works. So, clearly something in my old project broke it. Solved!

Ok cool :slight_smile: