I have made a script that adds force when it touches an object with the tag ForwardForceCollider and I have it tagged with the tag, but when i touch the collider nothing happens.
public class ForceCilinder : MonoBehaviour
{
public float pushForce = 10;
void OnTriggerEnter(Collider pushedObject)
{
if (pushedObject.gameObject.tag == ("ForwardForceCollider"))
{
Rigidbody pushedBody = pushedObject.GetComponent<Rigidbody>();
pushedBody.AddForce(transform.forward * pushForce, ForceMode.Impulse);
}
}
void Update()
{
}
}