Misc. Improvements
Turrets lead their projectiles Double click to equip/unequip/move Minimum weapon convergence distance
This commit is contained in:
parent
8629b35fd6
commit
922c8ea460
18 changed files with 240 additions and 69 deletions
|
|
@ -65,7 +65,7 @@ public class GuidedProjectile : MonoBehaviour
|
|||
}
|
||||
|
||||
var diff = Target.position - transform.position;
|
||||
var targetDist = diff.magnitude;
|
||||
var targetDist = diff.Flatland().magnitude;
|
||||
|
||||
if (_prevDist < targetDist)
|
||||
{
|
||||
|
|
@ -74,7 +74,7 @@ public class GuidedProjectile : MonoBehaviour
|
|||
_prevDist = targetDist;
|
||||
|
||||
var position = (float3) t.position;
|
||||
var sourceDist = length((float3) Source.position - position);
|
||||
var sourceDist = length(((float3) Source.position).xz - position.xz);
|
||||
var curveLerp = 1 - targetDist / (sourceDist + targetDist);
|
||||
var dir = diff.normalized;
|
||||
var right = cross(dir, float3(0, 1, 0));
|
||||
|
|
|
|||
Loading…
Reference in a new issue