Minor improvement for dino look_at

This commit is contained in:
karl 2019-11-23 21:16:10 +01:00
parent fc0a54fe82
commit 16a13dad6c
3 changed files with 3 additions and 4 deletions

View File

@ -28,6 +28,6 @@ func _process(delta):
dir = (_player.transform.origin - transform.origin).normalized()
if (dir.x != 0.0 and dir.z != 0.0):
look_at(Vector3(dir.x, 0.0, dir.z), Vector3.UP)
look_at(transform.origin + Vector3(dir.x, 0.0, dir.z), Vector3.UP)
move_and_slide(dir * speed)

View File

@ -35,10 +35,10 @@ transform = Transform( 1, 0, 0, 0, -4.37114e-08, 1, 0, -1, -4.37114e-08, 0, 7, 0
shape = SubResource( 2 )
[node name="Plane" type="MeshInstance" parent="."]
transform = Transform( -8, -2.54292e-07, 1.11155e-14, 0, -3.49691e-07, -8, 2.54292e-07, -8, 3.49691e-07, 0, 9, -1.19209e-07 )
transform = Transform( 9.5399e-08, 8, -3.49691e-07, 0, -3.49691e-07, -8, -8, 9.5399e-08, -4.17002e-15, 0, 9, -1.19209e-07 )
mesh = SubResource( 1 )
material/0 = null
[node name="CollisionShape2" type="CollisionShape" parent="."]
transform = Transform( -4.37114e-08, 0, 1, 0, 1, 0, -1, 0, -4.37114e-08, -8, 17.5719, 0 )
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 4.76837e-07, 17.5719, -8 )
shape = SubResource( 3 )

View File

@ -633,7 +633,6 @@ light_energy = 0.4
shadow_enabled = true
[node name="Player" parent="." instance=ExtResource( 9 )]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 15, 1, 34 )
[node name="Crystal" parent="." instance=ExtResource( 10 )]
transform = Transform( 1, 0, 0, 0, -4.37114e-08, -1, 0, 1, -4.37114e-08, 0, 2, 23 )