|
Good day fellow Uniters! Haven't used Unity since April, so I'm again confusing myself. For some reason, I cannot get Collision to work :? Script attached to my Cube (Which the player needs to walk into in order to test my Awesomely simple health script) as follow: And on the receiving side (Player) the following: And VIOLA! Nothing happens :( I have RigidBodies attached to both the Cube and the Player, Cube also has a Box Collider. If any Einstein replica's are willing to ease my pain, I bake quite lekker cookies (Shipping Excluded) :) Thanks!
(comments are locked)
|
|
make sure you have a collider on both, and that one has a non kinematic rigidbody.... If that still doesn't work, then try this script alternatively, you can try this:
If you need more help, then comment back... -Grady Hi @Grady. I keep getting the error message "Script error: OnCollisionEnter This message parameter has to be of type: Collision The message will be ignored." No matter what I try... Previously I have not received this error and no matter what I do, as soon as I click play, the error occurs. I do not have any other collision functions in my scene... Any Ideas?
Jul 09 '11 at 02:20 PM
Henri 1
Hi @Grady, I renamed my script and it seems to eliminate the error, but it still wont collide... I created a new scene, added some scripts and the collision did register, but it seems as if something in the script aint right, as it does register collision, but not with the script specified (collision.gameObject.tag == "Player"). I did try multiple other ways, but still not working :(
Jul 09 '11 at 02:38 PM
Henri 1
make sure that both objects have colliders, one has rigidbody that is non kinematic, and make sure that the object that you are attaching this script to is not tagged "Player". The object that you want to collide with has to be tagged "Player". So in other words, the other object that does not have this script on it must be tagged "Player" I've also edited my answer above so you can try a different method... -Grady
Jul 11 '11 at 08:24 AM
Grady
Hi @Grady, So long since I replied. Sorry that I havent chose your answer as "Best Answer", but I ended up using "OnControllerColliderHit" which worked, but for some reason slowed down my audio playback everytime I use one of my player's powers. Thanks again for your help. Again I'm strugling with my collisions, just posted a question. Maybe you can check it out? Adios
Dec 13 '11 at 09:21 PM
Henri 1
OK, glad I could be of some help!
Dec 14 '11 at 11:12 AM
Grady
(comments are locked)
|

Does the player have a collider?
Hi Dreamblur, the player has no specific collider (such as mesh or box collider) but it does have a ThirdPersonController script which basically has a capsule collider. Everything in my scene works 100%, player can walk, jump, fly, run shoot beams, powerup etc, just the darn collision doesnt work. If you browse my previous questions, you will notice that I have struggled before with sending messages, but at that time my collision worked 100%. Now I deleted the script, cant find it in my backups and couldn't remember exactly what I need to do :(