Colliders in if statement

I’m trying to make an arm grab the ground. I did this by creating a separate collider on top of the ground so it can act as a trigger without my character falling through the real ground.

As of now I’m just using a basic script that freezes the “hand” anywhere in the gamespace.


function Update() {

if(Input.GetKey(KeyCode.Space))
	{rigidbody.isKinematic = true;}
else
	{rigidbody.isKinematic = false;}

}


How can I make it only go kinematic when it’s inside the collider? the collider is called ‘ground’. I’ve tried doing it myself but my I just started to learn javascript. Any help is appreciated.

Thanks!

You can tell colliders to ignore other colliders, search the docs for “ignore collision” or you can turn the arm into a trigger and just say

OnTriggerEnter… then have an if(other.CompareTag(“ground”)…