Why are we defining enemy move speed twice?

Why are we defining enemy move speed twice? Once in:-

EnemyPathing.cs

 [SerializeField] float MoveSpeed = 2f;
var movementThisFrame = MoveSpeed * Time.deltaTime;

z

& another in WaveConfig.cs

[SerializeField] float MoveSpeed = 2f;
public float GetMoveSpeed() { return MoveSpeed; }

wa

Hi Ankush,

Well spotted. This is something one could refactor because one of the speed fields is obviously superfluous.

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.

Privacy & Terms