Have added mesh Collider still I fly trough

Hello

I am making space game, I have mesh collider and mesh Renderer on my space rock (witch I don't want to fly though).

Then I have my spaceship witch is set up with main camera, in the main camera I have the spaceship and it has mesh Renderer and mesh Collider on it.

I have found out if I put rigid body on the space rocks I don't fly though them, but if I have the rigidbody they start moving every time I tough them.

I don't know what to do :S My thecher can't even help me.

If there is any one here who can help me with collider and mesh problem in space game, any help would be grate. The problem is that I don't know how to make object have mesh so I don't fly trough them. I am new to Unity and I am making game in my school and the teacher there are not weary help full :S

1 Answer

1

Colliders that aren't rigid bodies will only cause collision events, not physical responses from the physics engine. If you don't want the rocks to move, make them very massive and give your ship a small mass. F = ma. Simple physics.

I tryed to give the rock a heigh mass, but don't know how to give my ship a small mass. Even if the rocks have heigh mass they still move then I touth them. I tryed to put a rigidbody on the shipand low mass on it and the rock still moves when I touth him.

"High" and "Low" are relative. Anyway, if you really want the Rock to stay stationary check the "Is Kinematic" box on it's RigidBody component and it won't respond to physics (but the ship will still collide with and not move through it.

Thanks for all the help so far. If i check the"is kinematic" box in the rigidbody the ship will fly through it as you say. Is there no way of doing this so the ship will no fly through, the space rock dose not have to have rigidbody.