private void ApplyInstantForce(GameObject target) { Vector2 forceToAdd = forceInfo.CalcDirectionAndForce(target, Source); //Debug.Log("adding " + forceToAdd); if (forceInfo.resetCurrentVelocity == true) { target.Entity().Movement.MyBody.velocity = Vector2.zero; } target.Entity().Movement.MyBody.AddForce(forceToAdd); }
private void ApplyForce() { Vector2 knockback = forceInfo.CalcDirectionAndForce(Target, Source); if (Target != null) { if (forceInfo.resetCurrentVelocity == true) { Target.Entity().Movement.MyBody.velocity = Vector2.zero; } //Debug.Log(knockback + " has been applied from " + SourceEffect.effectName + " on " + SourceAbility.abilityName); Target.Entity().Movement.MyBody.AddForce(knockback); } }