like pain from naruto, I wanna be able to press a button and be able to push objects
here's my push method
void DoPush()
{
Collider[] colliders = Physics.OverlapSphere(transform.position, pushRadius);
foreach (Collider pushedObject in colliders)
{
if (pushedObject.CompareTag("Enemy"))
{
Rigidbody pushedBody = pushedObject.GetComponent<Rigidbody>();
pushedBody.AddForce(-transform.forward * 500, ForceMode.Force);
}
}
}
the problem with this method is when I go behind the objects I push, they go towards me