IsValid not checking properly?

I’m using IsValid to check if a UObject can be accessed before to execute a function from it, but I’m still getting read access violation error. Shouldn’t the IsValid function guarantee that the object is safe to read?

It happened again, but this time in the IsValid call it self. I really don’t understand what is going on here.

To solved this I had to add UPROPERTY() header on the CurrentAction declaration.

Could you try to use IsValidLowLevel() instead? I think you need to check if it is nullptr or not aswell.

Yes this is true. For people experiencing similar issues: The reason you need to use the UPROPERTY specifier is because UE garbage collects variables not using this specifier and who remains unused for some time.