im wondering how you make a pressure plate system, so when you put some sort of heavy object on it, it will open something
i just need help to make the door move when something is on the pressure plate
Answer by alexanderameye · Nov 16, 2016 at 07:26 AM
Hello!
this tutorial will teach you how can check for collisions, so that when an object enters a collider box that is placed above the pressure plate, some variable will be set to 'true'.
The next step is to check whether or not that certain object has a certain mass, since you might only want objects with a mass > a certain value to be able to open the door. To check the mass of a rigidbody, you can use Unity's documentation.
https://docs.unity3d.com/ScriptReference/Rigidbody-mass.html
Now you can set the Boolean to be only true when the collider of the rigidbody is colliding with the collider on top of that pressure plate that functions as a trigger, AND when Rigidbody.Mass exceeds a certain value. Then in your script you can do something like this:
if(Boolean == true) { Open(); }
Note that this code won't work like this, but it gives you an idea on how to achieve the opening of the door. For the opening of the door you might be interested in checking this asset I created. With this asset you'll simply have to call the Open(); function that is located in the Door script only when Boolean == true.
Hope this get's you on the right path to solving your problem!
Your answer
![](https://koobas.hobune.stream/wayback/20220612100746im_/https://answers.unity.com/themes/thub/images/avi.jpg)