Hello,
I am trying to do something with instanced nodes. The instancing code looks something like
var node = []
var node_prefab = load("res://Node.tscn")
func _ready():
for i in range(x):
node.append(node_prefab.instance())
add_child(node[i])
Then I change the values with something like this:
func _physics_process(delta):
for i in range(x):
node[i].variable = a
The variable in question depends on the node type. When the project runs, the code to assign the variables doesn't work and nothing happens. However, when I check with print(), the correct variables aren displayed. It's like my code is not correctly applying the change to the actual instanced nodes in the scene. What am I doing wrong?
Edit : I realize that some of the variables work. What doesn't work is 6DOF physics joints. According to debug, the variables to set the spring force and the damping and link the joint to the body and wheels are getting passed to the joint, but the joint does nothing. It's supposed to act as a car suspension but it just does nothing.
:Here's a link to the problem
I don't understand what's going wrong. Is it something with joints specifically?