Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Method not found, return NULL with #102856

Open
chihwahli opened this issue Feb 14, 2025 · 4 comments
Open

Method not found, return NULL with #102856

chihwahli opened this issue Feb 14, 2025 · 4 comments

Comments

@chihwahli
Copy link

chihwahli commented Feb 14, 2025

Tested versions

4.3 stable mono only tested and found this bug

System information

Godot v4.3.stable.mono - Windows 10.0.26100 - Vulkan (Forward+) - dedicated NVIDIA GeForce RTX 4090 Laptop GPU (NVIDIA; 32.0.15.7216) - AMD Ryzen 9 7945HX3D with Radeon Graphics (32 Threads)

Issue description

An indent, tab I guess, not sure. caused the method not to be found. Tried reloading project, delete .Godot folder to re-import, restart of Godot + visual studio core. Nothing helped.

characterNode is of type character3D
stateMachine is just a simple node
switchstate is a method in stateMachine

Then I typed the code:

            GD.Print(characterNode.GetType());
            GD.Print(characterNode.stateMachineNode.GetType());
            GD.Print(type.GetMethod("SwitchState"));

it returned:
Player
StateMachine
null

Eventually I just looked at the code , found that the method name SwitchState was indented too much to the right, so I moved it back to the correct position, and suddenly all was well. I tried to replicate the error again, by using a combination of tab and or space bar. But could not replicate it.

After that the above code returned, what was expected:
Player
StateMachine
Void SwitchStateT

Because I could not replicate it, I find it useless to attach the godot project for review. if needed, do tell, then I attach.

Steps to reproduce

was just coding, accidentally indented or something else, causing the method not to be found.

Minimal reproduction project (MRP)

no more info. cannot reproduce bug somehow.

@AThousandShips
Copy link
Member

This needs more information, what is the StateMachine class?

Please try to replicate this so that you can provide details on how to replicate this, otherwise we can't really help without more information

@chihwahli
Copy link
Author

statemachine type, is the most simple node in Godot. grey circle. just called type: node

I will try more. It is just a shame I did not make an backup while the problem persists. Sticky note: backup always.

@AThousandShips
Copy link
Member

But where is the method SwitchState declared? Please show some more of your code, there's no such built-in type so it's important to get an idea of what you are doing

@chihwahli
Copy link
Author

dungeon-2.5D-WIP-#2-at-lesson-24.zip

This backup is a bit past that point. But has the class that has the problem. I also did not clean up the tmp files, maybe something is in there?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants