diff options
| author | realtradam <[email protected]> | 2020-03-19 03:28:23 -0400 |
|---|---|---|
| committer | realtradam <[email protected]> | 2020-03-19 03:28:23 -0400 |
| commit | 57c5f73d0d957dc426d922d591fa5a0dd1452892 (patch) | |
| tree | 490e1eaf130d7c3eab82c34505e1153d4837d002 /Racing-Game/4WheelCar/Weight.gd | |
| parent | 2e7c27e3934fd9c73f7e6cd414a50a9a17e1669c (diff) | |
| download | optimal-direction-57c5f73d0d957dc426d922d591fa5a0dd1452892.tar.gz optimal-direction-57c5f73d0d957dc426d922d591fa5a0dd1452892.zip | |
made weight distribution also more modular
Diffstat (limited to 'Racing-Game/4WheelCar/Weight.gd')
| -rw-r--r-- | Racing-Game/4WheelCar/Weight.gd | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/Racing-Game/4WheelCar/Weight.gd b/Racing-Game/4WheelCar/Weight.gd new file mode 100644 index 0000000..ea9e615 --- /dev/null +++ b/Racing-Game/4WheelCar/Weight.gd @@ -0,0 +1,26 @@ +extends RigidBody2D + + +# Called when the node enters the scene tree for the first time. +func _ready(): + pass # Replace with function body. + + +# Called every frame. 'delta' is the elapsed time since the previous frame. +#func _process(delta): +# pass + +func initVars(dataArray): +# #---Creating and attaching pinjoint to wheel + mass = dataArray[2] + var tempA = PinJoint2D.new() + tempA.set_position(Vector2(dataArray[0],dataArray[1])) + print(get_parent().get_parent().get_path()) + tempA.set_node_a(get_path()) + tempA.set_node_b(get_parent().get_parent().get_path()) + tempA.softness = 0 + tempA.bias = 0 + tempA.disable_collision = true + get_parent().add_child(tempA) +# #--- + pass |
