The Godot Q&A is currently undergoing maintenance!

Your ability to ask and answer questions is temporarily disabled. You can browse existing threads in read-only mode.

We are working on bringing this community platform back to its full functionality, stay tuned for updates.

godotengine.org | Twitter

0 votes

i'm trying to do is reuse the code i made for a minigame with levers which worked, where basically the levers have a specific class (Interactable) and if the raycast detects that specific class somethig can be triggered, i simply took the code and nodes and i was trying to reuse it for a kill interaction in multiplayer and the only thing i did is renaming the class and the variables, i also have another part of the code in the other player where it's class is being set to "Killable" but it gives a weird error it didn't give me with the levers even if i'm doing the same thing, here's the images:

Working Lever Code

Working raycast 1 code

Player 1 code 1/2

Player 1 code 2/2

Player 2 raycast code

Godot version 4.0
in Engine by (12 points)

1 Answer

0 votes

Hi
I also encountered this problem several times.
Be sure to create the class in a separate file
Sometimes the problem is solved by restarting Godot once.

by (22 points)

I already restarted but i had no luck :( what do you mean to create the class in another file? i think it's already in a different script

Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read Frequently asked questions and How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to [email protected] with your username.