public override void onTriggerStay(PlayerStats stats, ControllerGame controllerGame) { Vector3 dPosition = gameObject.transform.localPosition - controllerGame.getPlayerPosition(); float forceToApply = forceAtCenter * (Mathf.Pow(0.5f, dPosition.magnitude / forceHalflife)); //Debug.Log("Force to apply : " + forceToApply); dPosition.Normalize(); dPosition *= forceToApply; controllerGame.applyForceToPlayer(dPosition); }
public override void onTriggerStay(PlayerStats stats, ControllerGame controllerGame) { controllerGame.applyForceToPlayer(_force); }