Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

I cannot move a object #11

Closed
ZhengzhongSun opened this issue Jul 21, 2016 · 6 comments
Closed

I cannot move a object #11

ZhengzhongSun opened this issue Jul 21, 2016 · 6 comments

Comments

@ZhengzhongSun
Copy link

I have tested your script in many objects and it worked well. But today I try to grab a bird model, this model settings are the same as other objects, but I cannot grab it and it won't become highlight when I touch it.
bird
Could you give me any advice? Thank you very much!

@JScott
Copy link
Owner

JScott commented Jul 21, 2016

For sure! If it won't highlight then the problem is having the grip's sphere collide with the object. NearestObject() is doing the heavy lifting there, so OnTriggerEnter isn't being thrown.

The thing that immediately stands out to me are the two colliders and one of them being a concave mesh collider. I'm not sure what Unity does with two colliders so you might want to chose one and delete the other. You should also make the mesh one convex if you keep it. I expect that one of those 999+ errors is going to be Unity telling you that Rigidbodies colliders in Unity 5 must be concave.

Play around with that a bit and let me know how it goes. If you're still getting trouble then I'll have to try to recreate your scene and see if I can reproduce (and fix) the issue you're seeing.

@ZhengzhongSun
Copy link
Author

I have removed the mesh collider, but I still cannot move the bird. Could you have a try about the obj?
bird.zip

@JScott
Copy link
Owner

JScott commented Jul 22, 2016

I'll give it a shot when I have some time and let you know how it goes. Are there any components or scripts affecting the bird object other than what I can see in your screenshot?

@ZhengzhongSun
Copy link
Author

Thank you very much! I don't think there are any components or scripts affecting the bird object .

@JScott
Copy link
Owner

JScott commented Jul 23, 2016

Figured it out: it was your model. I'm not sure why Unity didn't like it but the object centre was way off and it was preventing the colliders from working properly. I recentred it in Blender and brought it back in and it works just fine:

original centre
fixed centre
bird comparison

The original you sent is on the left and the fixed OBJ is on the right. For your convenience, here's the model:

bird_fixed.zip

So many of my problems come from models not exporting properly and Unity doing weird things as a result :)

@ZhengzhongSun
Copy link
Author

Thank you very much! I will try it again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants