Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 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 mread · Nov 06, 2018 at 05:13 AM · collisionvr

VR: I want Collision wether holding it or not.

VR, Vive, i have 2 objects, colliding ok, i can drop one (mesh) onto another (sphere) and detect collision. - using OnCollisionEnter and OnCollisionExit to bool whether in sphere collider.

but collsion doesnt start unless i drop it and it collides.. i want to be able to still hold object and do same collision

Any pointers? cheers

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 mread · Nov 06, 2018 at 07:05 AM 0
Share

i guess im also asking about why does collision not happen when im still holding the object? the object i can pick up has the throwable.cs script on it

avatar image Casiell · Nov 06, 2018 at 08:49 AM 0
Share

So what's your code for picking up objects? $$anonymous$$aybe you change something there?

avatar image mread Casiell · Nov 06, 2018 at 09:01 AM 0
Share

havent written any code for picking things up, just used throwable.cs, and put colliders on both objects. i looked in throwable but its $$anonymous$$d bending. i just dont know where to look next

avatar image Casiell mread · Nov 06, 2018 at 09:07 AM 0
Share

Ok, but what is throwable.cs? It's not a default Unity component, it came from some package you installed. Also you really should try and understand what the things you import really do. It's probably something in this script as it's quite common to disable collisions of an object you hold in your hand

Show more comments

2 Replies

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

Answer by Casiell · Nov 06, 2018 at 09:36 AM

What you are looking for is something that modifies settings on objects collider or rigidbody.

It may turn it off, it may change the collider type to trigger or rigidbody to kinematic. That's three things from the top of my head.

What you can do to make sure is actually look at your objects inspector when you are holding it to see the settings on both collider and rigidbody.

For the future you really should include the scripts that you are using (never mind yours or from package) because downloading whole package is usually an overkill just to point out a single line that you should change.

Right now I found those scripts an github and I can tell you that in line 122 rigidbody is set to kinematic. According to unity manual on colliders: kinematic rigidbodies do not collide with static colliders (without rigidbody).

What you could do is not set the rigidbody to kinematic or add rigidbody to objects you want your item to collide with. Both options have some consequences, but I will let you experiment an deal with that in a way you see fit.

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 mread · Nov 06, 2018 at 11:28 AM 0
Share

thats a huge help thanks heaps, i backed out of my long winded reply by mistake, but ill be reporting back with the answer hopefully soon, thanks again. noted on including info, ta

avatar image
0

Answer by mread · Nov 07, 2018 at 12:55 AM

ok.. got an answer thats close.. not sure about some aspects..

i read the collider link and understand sort of that to collide, there is a matrix of what will and what wont provide onCollision events. im pretty sure i was following the matrix and should have been producing a OnCollisionEnter, but i wasnt, for whatever reason.. when i pick up an object it becomes kinematic, and the collider (however it the object was set up, according to matrix) should have produced OnCollisionEnter but didnt.. (obviously i was missing something but couldnt figure it out).

but, during learning, realised that what i wanted to do was trigger, not collide.. im a newb so its still a bit of a grey area but what i wanted to do was actually trigger it if intersected. not collide) so i stopped using OnCollisionEnter(Collision col) and started using OnTriggerEnter(Collider other) and all works wonderful! (triggers are much simpler, kinematic etc doesnt really apply, triggers dont come with all the extra info Colliders do though loc/rot/etc..)

to any other noobs reading this, theres no code to post, its just using the appropriate events and having the objects set up correctly. watch this youtube vid on Collsions, triggers and read the link on colliders Casiell provided.

im marking Casiells post as answer cause its as good as it gets. thanks

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

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

177 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 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 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 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 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 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 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 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 avatar image

Related Questions

VR - Collision despite istrigger is set as on 1 Answer

Add mesh colliders to (any) SteamVR controllers (in unity) 0 Answers

OnTriggerEnter keeps firing.. 2 Answers

Cant get arrow to stick 2 Answers

Animate gameobject when collided with another gameobject using VRTK 0 Answers


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