Slightly modify enemy LoS stuff
This commit is contained in:
@@ -136,7 +136,7 @@ public partial class Enemy : CharacterBody3D, IEnemy, IProvide<IEnemyLogic>
|
||||
rng.Randomize();
|
||||
var randomizedSpot = new Vector3(rng.RandfRange(-7.0f, 7.0f), 0, rng.RandfRange(-7.0f, 7.0f));
|
||||
EnemyLogic.Input(new EnemyLogic.Input.PatrolToRandomSpot(GlobalPosition + randomizedSpot));
|
||||
PatrolTimer.WaitTime = rng.RandfRange(1.0f, 3.0f);
|
||||
PatrolTimer.WaitTime = rng.RandfRange(5.0f, 10.0f);
|
||||
}
|
||||
|
||||
public void OnPhysicsProcess(double delta)
|
||||
|
||||
@@ -97,7 +97,7 @@ IgneousDamageBonus = 0.0
|
||||
FerrumDamageBonus = 0.0
|
||||
|
||||
[sub_resource type="CylinderShape3D" id="CylinderShape3D_jbgmx"]
|
||||
height = 3.0
|
||||
height = 4.83757
|
||||
radius = 1.0
|
||||
|
||||
[sub_resource type="BoxShape3D" id="BoxShape3D_0yire"]
|
||||
@@ -563,7 +563,7 @@ collision_layer = 2
|
||||
collision_mask = 2
|
||||
|
||||
[node name="CollisionShape3D" type="CollisionShape3D" parent="LineOfSight"]
|
||||
transform = Transform3D(1, 0, 0, 0, 0.0745088, 0.99722, 0, -0.99722, 0.0745088, 0, 0, -1.46944)
|
||||
transform = Transform3D(1, 0, 0, 0, 0.0745088, 0.99722, 0, -0.99722, 0.0745088, 4.14153e-08, 0, -1.94318)
|
||||
shape = SubResource("CylinderShape3D_jbgmx")
|
||||
|
||||
[node name="PatrolTimer" type="Timer" parent="."]
|
||||
|
||||
@@ -86,7 +86,7 @@ FerrumDamageBonus = 0.0
|
||||
radius = 1.0
|
||||
|
||||
[sub_resource type="CylinderShape3D" id="CylinderShape3D_jbgmx"]
|
||||
height = 3.0
|
||||
height = 4.12783
|
||||
radius = 1.0
|
||||
|
||||
[sub_resource type="BoxShape3D" id="BoxShape3D_0yire"]
|
||||
@@ -547,7 +547,7 @@ collision_layer = 2
|
||||
collision_mask = 2
|
||||
|
||||
[node name="CollisionShape3D" type="CollisionShape3D" parent="LineOfSight"]
|
||||
transform = Transform3D(1, 0, 0, 0, 0.0745088, 0.99722, 0, -0.99722, 0.0745088, 0, 0, -1.46944)
|
||||
transform = Transform3D(1, 0, 0, 0, 0.0745088, 0.99722, 0, -0.99722, 0.0745088, 1.13364e-08, 0, -1.59911)
|
||||
shape = SubResource("CylinderShape3D_jbgmx")
|
||||
|
||||
[node name="PatrolTimer" type="Timer" parent="."]
|
||||
|
||||
@@ -20,7 +20,7 @@ public partial class EnemyLogic
|
||||
var delta = input.Delta;
|
||||
var enemy = Get<IEnemy>();
|
||||
var targetPosition = enemy.NavAgent.GetNextPathPosition();
|
||||
var velocity = (targetPosition - enemy.GlobalPosition).Normalized() * 3.0f;
|
||||
var velocity = (targetPosition - enemy.GlobalPosition).Normalized() * 1.0f;
|
||||
enemy.Velocity = velocity;
|
||||
enemy.Rotation = new Vector3(0, (float)Mathf.LerpAngle(enemy.Rotation.Y, Mathf.Atan2(enemy.Velocity.X, enemy.Velocity.Z), delta * 10.0), 0);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user