Wait for seconds on collision

So I’m trying to create a script that will, on collision wait for 1/10th of a second and then zero the player velocity, speed etc (I’m doing this because otherwise the player spins of in a random direction with the force applied beforehand). How do I do this in C#.

This is my script so far:

using UnityEngine;
using System.Collections;

public class Player1 : MonoBehaviour {

	public float directionalSpeed = 7.5f;
	public float rotationalSpeed = 5f;
	void Start () {
	}

	// Update is called once per frame
	void Update () {
		transform.Translate(Vector3.right * (-Input.GetAxis("Vertical")) * Time.deltaTime * directionalSpeed);
		transform.Translate(Vector3.down * Input.GetAxis("Horizontal") * Time.deltaTime * directionalSpeed);
		transform.Rotate(Vector3.forward * 10 * Input.GetAxis("Rotate") * Time.deltaTime * rotationalSpeed);

	}
	void OnCollisionEnter(Collision c)
	{
		transform.Translate (Vector3.zero);
	}
}

Any suggestions?

Hello Kuro,

for everything where you want to use a waiting timer, you can use this Unity - Scripting API: Coroutine

also if i see it correctly, you are doing all 3 calls on the update, even when it can be that only one is really needed.
i recommend you to make a ifelse or a switchcase before it to really only call the fuctions you want to get called, instead of calling all.

Greetings
Gardosen