Physics
public class Bouncer : MonoBehaviour
{
public float launchImpulse = 15.0f;
public bool overrideVerticalVelocity;
public bool overrideLateralVelocity;
private void OnTriggerEnter(Collider other)
{
if (!other.CompareTag("Player"))
return;
if (!other.TryGetComponent(out Character character))
return;
character.PauseGroundConstraint();
character.LaunchCharacter(transform.up * launchImpulse, overrideVerticalVelocity, overrideLateralVelocity);
}
}Last updated