Please explain IsA()

You getting crash most likely because PinKnocked is null or object it was pointing to was destroyed and pointer is invalid (pointing to unaccessable memory address), if you call on nulll or invalid pointer you gonna have a crash, so do 2 things. Where ever you use that IsA check do check if PinKnocked is not null. Don’t worry if first condition fails the 2nd won’t be checked so you wont have a crash

PinKnocked && PinKnocked->IsA(AActor::StaticClass)

But this won’t prerevent crash for invalid as pointer points somewhere so it’s not null, nativly there is no way to check if pointer is valid, so pointers need to be tracked and UE4 has such menanisms. In case of UObject is very easy, all you need to do is add UPROPERTY() before varable, it adds varable to reflection system which keep track of it, if object that is pointing to is destroyed, reflection systems nulls all properties that it was pointing to. Keep in mind this works only on UObjects (which means also on actors).