Collision Horror

Hi all,

I have been using unity for about a month now. At first it was quite impressive but now I find it more and more annoying to work with. It seams to make simple things unnecessery hard. So far I chop it off to beeing unfamiliar with unity and continue to give it a fair chance.

After a lot of online research I found that it is quite impossible to get your rotation the way they are in a modeling programm (not one that works). Astonishing that the unity developers come up with demo games and don’t seam to have a problem with it. At any rate you can just rotate your objects into place within the modeling software. That is until you try to animate some objects.

What I have now is an animated object that is supposed to be an obstacle for the player. I use some simple bone animation which I am doing in maya. Everthing imports the way it should and the animation is played correctly. Just using collision detection seams about impossble. According to this info: the best way of doing it would be to use a collider for each joint. However, the colliders don’t fit the shape of my model. Also, you can only resize them and offset them along an axis but not rotate them into place if needed. I can also not generate a mesh collider because I can not rotate and move it to it’s proper position. Therfore, I can not make any colliders that actualy fit the shape of the model.

Also, I have a simple sphere that is suppoed to collide with box and mesh colliders. However, the sphere sometimes falls through the colliders. Mostly in mesh colliders where two faces of the mesh would be adjacent but sometimes it also passes through a box collider. The shpere is moved in the scene using addForce() which makes me think that the physics engine should be able to handel it. Further more the shpere is not moving very fast so that you could run into issues by moveing from one side of a collider onto the other side within one frame.

Here are my question:

  • How do you apply collision detection on an object that is animated (uisng bones)?
  • What do you have to take into consideration in order to make your collision more stable?

First of all thank you for your input and taking the time. I will try to be more specific in regard to your points:

A) I have chosen that title because all kind of collision seams to be troubleing. However, I will try to use more fitting titels in the future. Sorry for the confusion.

B) I am very well aware that unity is a game engine and not a modelling porgram. This means you will have to modell your assets elsewhere. In my case I use maya. I also use maya for creating animations using bones. I want to attach colliders to such an animated asset. Like I stated in my initial post, I can not position the colliders in such a way that they enclose the mesh properly. The colliders are attached to the joints and I would need to offset the colliders to make them fit the mesh more properly. But in order to do that I would need to rotate the colliders into place and not just scale and move them. Then at least I could use more than one collider to enclose a specific part of the mesh and make it fit better.

C) Yes, the colliders are supposed to move and rotate with the object that is holding them. But in order for the colliders to do that porperly, I need to first place them. I want to set their starting position so that while the animation is playing in game they move/rotate with the animation but in the correct place (encaplusating the mesh and not moving aside next to the mesh).

D) The colliders are moving according to the animation, just not on top of the mesh (like mentioned in point c). I will however look more into the animate physics option.

E) I am certain the colliders are not set to Tigger.

Also, I still have the issue that a simple shpere can pass through a box collider. This scenario has about the complexity of pong. Surely unity can hande this?