BNM-Android icon indicating copy to clipboard operation
BNM-Android copied to clipboard

Unable to find extern FindObjectFromInstanceID

Open Pubert-CS opened this issue 1 year ago • 8 comments

While using BNM on a Unity 6 game, I get this error while calling hit.GetCollider() from a RaycastHit. Extern method UnityEngine.Object::FindObjectFromInstanceID isn't found. Please check the code. Please fix!

Pubert-CS avatar Aug 06 '25 23:08 Pubert-CS

Fixed in v2.5.1, but untested

BNM-Dev avatar Sep 25 '25 13:09 BNM-Dev

Fixed in v2.5.1, but untested

Thank you for the update, but I believe the problem is that FindObjectFromInstanceID and FindObjectFromInstanceID_Injected simply aren't extern in some versions.

Image Image

Pubert-CS avatar Sep 27 '25 21:09 Pubert-CS

Can you tell what version of Unity it is?

BNM-Dev avatar Oct 01 '25 13:10 BNM-Dev

Can you tell what version of Unity it is?

I think 2023+ versions have it as non-extern, but versions under requires extern I think aswell. If anyone can fact check me please do!

crimsonlmaoo avatar Oct 03 '25 22:10 crimsonlmaoo

Can you tell what version of Unity it is?

I think 2023+ versions have it as non-extern, but versions under requires extern I think aswell. If anyone can fact check me please do!

Unity 2023.2.0 and 6000.0.0 have extern FindObjectFromInstanceID_Injected.

BNM-Dev avatar Oct 04 '25 08:10 BNM-Dev

Can you tell what version of Unity it is?

I think 2023+ versions have it as non-extern, but versions under requires extern I think aswell. If anyone can fact check me please do!

Unity 2023.2.0 and 6000.0.0 have extern FindObjectFromInstanceID_Injected.

I might be wrong, but I'd say do GetMethod instead of GetMethodExtern for versions under 2023 if FindObjectFromInstanceID isn't extern on the versions under

crimsonlmaoo avatar Oct 04 '25 18:10 crimsonlmaoo

Can you tell what version of Unity it is?

The unity version for the game I was doing was 6000.2.2f1. I've seen it in some other 6000 versions too though. Is there any way you can make it fallback to using class methods instead of extern?

Pubert-CS avatar Oct 05 '25 00:10 Pubert-CS

fallback to using class methods

I don't like use BNM API for extern methods that calls libunity. This is a bit overhead.

I was doing was 6000.2.2f1

I checked 6000.0.0f1, 6000.2.2f1 and 6000.2.6f2. All have extern FindObjectFromInstanceID_Injected

Image

Can you send game or app that you working on? This is strange. Unity's _Injected methods should be extern, this is Unity API design.

BNM-Dev avatar Oct 05 '25 13:10 BNM-Dev