summaryrefslogtreecommitdiffhomepage
path: root/Racing-Game/4WheelCar/Weight/Weight.gd
blob: ea9e6154adba9c22e28000f1de28d7ce021b9c23 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
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