mirror of
https://github.com/mightypanders/GMTKJam2021.git
synced 2025-01-30 21:59:55 +01:00
add follow_node
This commit is contained in:
parent
a6ab00b81e
commit
179a912f13
9
Playa.gd
9
Playa.gd
@ -24,17 +24,18 @@ func add_Guest_to_Line(parent,guest):
|
||||
parentAnchor.add_child(get_a_springjoint(parent,guest))
|
||||
var pua = guest.get_node("PickUpArea")
|
||||
pua.monitorable = false
|
||||
guest.follow_node = parentAnchor
|
||||
#springJoint.rotation = -rotation
|
||||
return guest
|
||||
|
||||
func get_a_springjoint(parent,child):
|
||||
var springJoint = DampedSpringJoint2D.new()
|
||||
#springJoint.rotation+=get_angle_to(guest.global_position)
|
||||
springJoint.length = 5
|
||||
springJoint.rest_length = 5
|
||||
springJoint.stiffness = 64
|
||||
springJoint.set_length(1)
|
||||
springJoint.set_rest_length(0)
|
||||
springJoint.stiffness = 100
|
||||
springJoint.damping = 1.0
|
||||
springJoint.disable_collision =true
|
||||
springJoint.disable_collision = true
|
||||
|
||||
springJoint.node_a =parent.get_path()
|
||||
springJoint.node_b =child.get_path()
|
||||
|
Loading…
Reference in New Issue
Block a user