- Home /
How do I make a sensor for a First Person controller
I have attempted to make an invisible, intangible, and unmoving block that, having come into contact with first person controller, will cause a Debug.Log function to take place. I have succeeded at making the block but have been met with failure in regards to the code. Could you please help me?
It would be helpful if you detail exactly what you've tried. For example, have you already looked at OnCollisionEnter /etc, or are you just unsure where to start?
Answer by Johnnemann · May 31, 2013 at 06:28 AM
Unity has some functionality for this in the Trigger paradigm. Try creating a cube with a collider, setting it as a trigger, and then using OnTriggerEnter() to print your debug message.
http://docs.unity3d.com/Documentation/ScriptReference/Collider.OnTriggerEnter.html
Your answer
![](https://koobas.hobune.stream/wayback/20220613103242im_/https://answers.unity.com/themes/thub/images/avi.jpg)