- Home /
C# Check If Gameobject is within Collider
I would like to check for if a gameobject is within a collider. The collider is turned off because I just want to use it for parameters. Any ideas how I can check for this? I've tried OncollisionEnter but that doesn't work since the collider is turned off.
Answer by DoctorMoney · Jul 17, 2014 at 03:28 AM
You could try enabling the collider and setting it to be a trigger and using OnTriggerEnter. It'll still give you the parameters of a collider and stuff will pass through it.
I need to be able to click on the gameobject within the collider. But when I try to click on the gameobject it selects the collider even though I have it set to on trigger.
If you're Raycasting to select/click objects just set the collider to the Ignore Raycasts physics layer.
I'm not using raycasting. I'm using void On$$anonymous$$ouseDown() in another gameobject's script. What can I do then?
Your answer
Follow this Question
Related Questions
C# Rotate GameObjects Regardless of List Size 2 Answers
C# Change Script Help 1 Answer
C# SetActive GameObject Array 2 Answers
C# GameObject Reverses Z Rotation 0 Answers
C# Find Which Axes Gameobject is on 1 Answer