Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by Zarkopafilis · Apr 25, 2014 at 10:35 AM · javascriptcollision

Collision Detection not working properly

I followed this tutorial ([url]http://unity3d.com/learn/tutorials/modules/beginner/physics/on-collision-enter[/url])

And here is how my project looks like.(Its the FPC - player and 2 cubes. 1 for the ground and one named "qBlock") I want to destroy the qBlock as soon as the player collides with it(i.e. jumping ontop , on bottom etc) Code attached to the player:

 #pragma strict
 
 function OnCollisionEnter(collision : Collision) {
         if(collision.gameObject.name == "qBlock"){
         
         Destroy(collision.gameObject);
         
 
 
         }
     }

And this will help too: (I have not messed around with any physics settings...)

alt text

Update; I added rigidbody and collider to the box (disabling gravity - i want it to float). When I try to add these to the player , weird things happed (he ususally goes up into the sky)

alt text

When the capsule collider is added to the player and i press 'W' to move forward , he is getting launched into the sky.How can I fix that?

alt text

I also tried having the collider on the graphics child of player. Nothing worked!

Comment
Add comment · Show 5
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image wijesijp · Apr 25, 2014 at 11:22 AM 0
Share

Did you add rigidbody and collider to the objects?

avatar image Zarkopafilis · Apr 25, 2014 at 11:46 AM 0
Share

No , thanks for infor$$anonymous$$g me - the tutorial said nothing and its begginer-based . I have no experience

avatar image wijesijp · Apr 25, 2014 at 12:46 PM 0
Share

I am not very familiar with character controllers. I think you don't need to add physics and collider to it. Someone else maybe able to point you at the correct direction.

avatar image aero80 · Apr 25, 2014 at 12:54 PM 0
Share

CharacterController comes with its own collider.(center, radius, height all collider properties). You dont need the second capsule collider. That might be the issue.

avatar image Zarkopafilis · Apr 26, 2014 at 11:46 AM 0
Share

@aero80 U removed the second collider from the box and the second collider from the character. Nothing worked.... Im getting really pissed off

I added this line : print("collision !!!"); and it doesnt print in the console (outside of if statement)

2 Replies

· Add your reply
  • Sort: 
avatar image
0
Best Answer

Answer by Zarkopafilis · Apr 26, 2014 at 05:20 PM

Removed rigidbody from FPS controller - Added a capsule collider and made it a little bit bigger - Set collision detection on box's rigidbody to continuous

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image
0

Answer by BlackHoleStorm · Apr 25, 2014 at 02:38 PM

There's 2 colliders on your qBlock object, try removing one of those and see if that helps.

Comment
Add comment · Show 1 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Zarkopafilis · Apr 26, 2014 at 11:44 AM 0
Share

it did not work

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

22 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Object Collision PLEASE HELP!!! 1 Answer

Trying to proceed to next level when multiple items have collided 1 Answer

My Javascript collision isn't being detected, please help. 0 Answers

Player take damage on collision with AI 1 Answer

Finding a script on an object 1 Answer


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges