Seeing as I’m almost USELESS at coding, AND using C# cause I learned about it first, I’m having a hard time making a speedpad. So, basically I want a script (preferably attached to the gameobject) to test if the player is colliding with an object called “booster” (no caps). Heres what I have right now.
using UnityEngine;
using System.Collections;
public class Speedbooster : MonoBehaviour {
// Use this for initialization
void Start () {
}
// Update is called once per frame
void OnCollisionEnter(Collision collision)
{
if (collision.gameObject.name == "player")
{
GetComponent<Rigidbody>().AddForce(transform.forward * 500);
}
}
}
So, once again, if possible I want a thingy (forgot what its called ;- in the inspector that I can change to change the amount of speed the player gains.