Topic was automatically imported from the old Question2Answer platform.
Asked By
cvetirodrigez
When the hero script receives signal body entered I want to delete the bullet which is instance. I tested now it’s showing this Attempt to call function ‘queue_free’ in base ‘previously freed instance’ on a null instance.
"Attempt to call function ‘queue_free’ in base 'previously freed instance " means the bullet has already been deleted. Is there some other place in the script where you delete it?
if magic_copy the bullet that you’re trying to delete?
One simple fix is to just check if is_instance_valid(magic_copy): magic_copy.queue_free()
call_deferred has the following syntax: call_deferred("NameOfTheFunctionToCall", "ParameterToPassToTheFunction")
and what it does is it calls that function a bit later… like, after all the other code for that frame has been executed.