Why is godot’s multiple scripts per node feature so broken and feels not properly supported
For example I attach a script to a node then do extends right but then if I want to connect a signal to the first script I gotta detach then reattach the script connect signal then extend it again also wish it showed which scripts it had and not the latest one only (as shown in ss bottom) is there an extension of some sort that helps with these problems?
Yeah so I have 2 hands with each their scripts but the thing is they’re the same other than 1 variable so I combined them to a single script and then in their own script I overrides init to change a islefthand variable I also use this technique in my weapons and then change damage ammo count etc.
yeah but what about custom functions that export method will work for hands ty I’m stuipd how’d I not think of that but for weapons I also wanna add a few custom overrides or even new functions also since this is a mulitiplayer game a script handles all shooting sound position logic on multiplayer if I made 10 weapons when I changed smth I’d have to change it in all of them
For cases where you’re sure you want to add custom logic you could make your base script a custom class using class_name, make your nodes of that type, and implement unique logic in their scripts.
You have a few options here. I couldn’t give you much because you still haven’t described the problem you are having in concrete details. The quality of your answer depends on the effort you put into your question, and frankly you are writing like you think we can read your mind.
Option 1 - Single Script
class_name HandControl extends XRNode3D
Enum Hand {
LEFT,
RIGHT,
}
@export hand: Hand
func _ready() -> void:
if hand == Hand.LEFT:
print("Left Hand")
else:
print("Right Hand")
yeah I already have that but like it’s just annoying that you can’t connect a signal to the first script you attached after you’Ve extended another script to the node also sometimes stuff don’t work I re do the attaching then extending and it works so that systems just all funky I was wondering since godot is open source and all maybe some1 did some helper stuff to that
also yeah ig I’m writing it quite vaguely but I feel like this is enough information idk ig I did miss out some details and stuff sorry about that and thank you for the help btw!’
Now every script extended from it can use the signal. You’re making it sound like this is not only hard to do, but impossible.
If it was enough information you’d have an answer already. @normalized and I answer questions on here every day and neither of us can figure out what your problem actually is. I thought I’d answered it and all you said was, “I use inheritance.”
Was my answer helpful? Not helpful? Answer your question? Didn’t answer your question?