- Home /
Rigid bodies pushable
I have been having this problem for a while and I have been getting answers saying, "make the rigid body Kinematic". Well it doesn't work!
I have a layer which I have collidable invsable objects on (collidable) and a layer I have the player and interactable objects on, like walls and boxes and things (Level).
All of my walls or objects are instancated. nothing exists till an invisable collider on the player hits another invsabile collier on the collidable layer in the scene, and instancates an object into the Level layer.
So my problems is when I instancate a new object into the scene I can only use Gravity. If you make the object be Kinematic at all the object becomes phantom, for lack of a better term. The problem here is you can push the objects and they are not good for use as walls Kinematic or not!
This is very bothersome to me and I cannot find away around it.
Answer by karljj1 · Nov 27, 2013 at 05:48 PM
So you cant have kinematic objects as you need gravity to clamp them to the ground?
But you don't want people to be able to push them? What about adding a physic material to your collider that has very high friction?
http://docs.unity3d.com/Documentation/Components/class-PhysicMaterial.html
I like the idea. How high of fricion do I need to make it so a first person controler can't push an object?
1 is the highest. Also set the material Friction Combine to maximum.
here is an odd example of what is going on in the scene. my Character contorler is happy to move around on a Box Collider with no Ridid Body, but nothing else will...
Everything else needs to be a Ridibody and have Gravity to act like there is a floor or other objects that aren't supposed to be moved? No! This is an FPS style game. Ever been able to push a wall in an FPS? I hope not!
$$anonymous$$y understanding is that you cant make them kinematic as you want them to fall to the floor. How about placing them on the floor using a raycast down? Then you can make them kinmatic.
I've been trying the physic material idea, but it doesn't work. I can't make a material that inhbits movments completely 100%.
@karljj1: falling isn't really the important part, it is the ablity to inhibit movment of the player so they, the player, do not stupidly fall off the edge of the scene into the black void of nothing below the scene.
Answer by whitequill · Aug 14, 2014 at 02:14 PM
Go to the Edit menu > Project Setting > Physics. This will give the ability to tell what can be interacted with (can or can't be pushed) and what can't across layers.