|
Well im going to be straightfoward here, this is my code The "collisionObject" is the FPC and yes it has a rigidbody, the object the script is assigned to is a collision box with a Audio thing attached I have no idea why it wont play.... Thanks Myhijim
(comments are locked)
|
|
So, this script is on a collider w/rigidbody and should be hit by the player, which uses a CharControllers don't trigger OnCollisionEnter when they hit things. They don't use physics to move, which is where collisions happen. To test, add Instead need to use Thanks, but what if i dont want it to stop the player, i phrased the question badly, i just want a collision box that sets off a noise as the player goes through it
Jul 02 '12 at 03:03 AM
Myhijim
A zone that simply detects your presence is a triggerBox. Check
Jul 02 '12 at 05:34 AM
Owen Reynolds
Exactly what i needed! Thank you
Jul 05 '12 at 11:51 AM
Myhijim
(comments are locked)
|
|
collisionObject is a transform and collision.gameObject is a game object so they will never be equal! Perhaps define collisionObject as GameObject or check the transform of collision.gameObject. Nope that didnt work :( Thanks anyway
Jul 01 '12 at 12:03 PM
Myhijim
I suggest you Debug.Log both objects with .ToString(). They clearly aren't matching.
Jul 01 '12 at 12:10 PM
whydoidoit
(comments are locked)
|
