summaryrefslogtreecommitdiffhomepage
path: root/Racing-Game/4WheelCar/Weight.gd
diff options
context:
space:
mode:
Diffstat (limited to 'Racing-Game/4WheelCar/Weight.gd')
-rw-r--r--Racing-Game/4WheelCar/Weight.gd26
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