Skip to content

UnmanagedCallersOnly method from managed code. #65

@kzu404

Description

@kzu404

What is the game you are using with IL2CPP Resolver?

Ninja Kaizen

Details:

I trying to get gameobject and destroy it but always get "Fatal error. Invalid Program: attempted to call a UnmanagedCallersOnly method from managed code." and crash even after gameobject is found i just print for debug is still same error

void DestroyDetector()
{
	Unity::Object::Initialize();

	Unity::CGameObject* detectorManager = Unity::GameObject::Find("DetectorManager");

	
	if (detectorManager != nullptr)
	{
		//detectorManager->Destroy();
		printf("detectorManager GameObject found!");
	}
}

Screenshots/Video:

No response

Minimal, Complete and Verifiable Example code:

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions