Other
Speed pad/booster 3D
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.
Answer by Gurekam-Dhillon · Mar 02, 2016 at 06:16 AM
ALSO, if possible I want it to fling the player relative to the speedpads rotation.
Thanks
~Whateverthenameonthisaccountwas
Im closing this cause its in the wrong "zone" thingy.
Follow this Question
Related Questions
Increasing character movement over time 1 Answer
How to include speed trigger creation option in this script. 0 Answers
my rigidBody.velocity return values that are false 1 Answer
Space Shooter Bolt Speed Forward Issue 2 Answers
Getting two Objects to the same direction with different speed 0 Answers