Trying to make a 2D Spring

Still a Beginner at Unity 5 and this time I am trying to make a Spring.

The spring would act as you'd expect. Something comes in with a direction and force, so you bounce it the opposite direction of the way it came in. Something like this:

But for some reason my player object doesn't interact with my Spring. It goes right through it as if they are on separate layers.

As you see above it falls right through. Now here is my setup:

Finally the Spring Script:

using UnityEngine;
using System.Collections;

public class BounceOnContact : MonoBehaviour
{
void OnCollisionEnter2D(Collision2D collisionInfo)
{
Rigidbody2D rBody = collisionInfo.collider.GetComponent<Rigidbody2D>();
Vector2 vel = rBody.velocity;
float mag = vel.magnitude;

Your Spring object's BoxCollider2D has the Is Trigger box checked, which means that you need to check for collisions with OnTriggerEnter2D, rather than OnCollisionEnter2D.
• But then I lose the contacts[0].normal part that I'd get from Collision2D. Can I get that some other way by having a Collider2D? – OmniOwl Mar 21 '16 at 0:03
• @Vipar No, not directly. Why not just uncheck Is Trigger and use OnCollisionEnter2D then? It should work. – Nox Mar 21 '16 at 0:08