I’m using the plane as a speed-boosting pad. I’m sure it’s something in the scripts, but how can I use a collision with a certain other object (in this case, a specific plane) to cause the character’s speed to increase?
It looks like it’s something in the collision detection. I literally can’t get the character to recognize collisions at all, with anything. I’ve placed collision-detection code of various kinds, like this (http://unity3d.com/learn/tutorials/modules/beginner/physics/on-collision-enter) in various places in the ThirdPersonController script and a variety of places with a Debug.Log("hi"); to tell me if it’s working, and it never is. What could I be doing wrong?
I’ve even tried having the boost pad use CollisionFlags, which work fine with the character herself, but nope, it doesn’t recognize them. Why, world?!
AND the pad recognizes actual collisions when they’re happening with everything EXCEPT the character. I must’ve run over the dog of someone up there.
For the collision detection to work, your gameobject must have a rigidbody. After you get a OnColisionEnter you can use collision.relativeVelocity to get the impact velocity. Then you can modify your rigidbodies velocity to increase this.
FINALLY solved it!
Thanks, TiG, but the issue was recognizing the collision - both objects already had RigidBodies; I got it to work by modifying the “OnControllerColliderHit” function in the character’s ThirdPersonController (js) script and using the code (if hit.gameObject.name == "Boost Pad").
Oh, yeah, this is so cash! Time to get to making grind rails now!