|
So basically I want to be able to detect if my capsule collides with my sphere. Right now it just isn't working. Here is the script I place on the sphere: For some reason it never does any of this when the capsule collides with it. I have the capsule as a Rigidbody and a trigger, so I can't think of a reason why this won't work. Any help would be appreciated.
(comments are locked)
|
|
Ok the problem was that I never actually applied the rigidbody properly. Thanks for the help!
(comments are locked)
|
|
Is the Sphere that this script is on also a trigger? edit: actually the example code for C# does have some stuff not present in your script. I'm not a C# user myself but it might just need those first few extra lines and also the "public class example" part before it will work at all. I think as long as one of them is a trigger, OnTriggerEnter() gets called on both.
Jul 25 '11 at 08:53 PM
Alec Slayden
Yeah, I remembered that right after posting hehe, quickly edited with a better answer :P
Jul 25 '11 at 08:55 PM
Giometric
Yes I have that, I just edited out all of the other stuff so that you could see the script that was associated with the problem.
Jul 25 '11 at 09:41 PM
Infamous911
(comments are locked)
|
|
No but I tried that and it doesn't change anything.
(comments are locked)
|
|
Ok I went ahead and replicated the scene you described, and it seems to be working fine. This is what the entire script I have looks like: Though as you can see I commented out the Instantiate part, the Debug.Log part is definitely working. So I'm not sure what's going on with yours.. my scene is using a simple Unity sphere and capsule, the sphere has the script on it, and the capsule has a rigidbody applied and nothing else. Are you using a character controller on your capsule? Can you show me how you're applying the Rigidbody? Maybe that has something to do with it.
Jul 25 '11 at 10:23 PM
Infamous911
(comments are locked)
|
