Scripting trouble, Float on Collision/collision open gate

I am working on my first unity scene and I want to make an object float up when it is bumped into. I know how to write a script to make it float but not when its collided with. I also want to make a gate when opens when the avatar walks into it. I am fairly new at scripting and have been trying combine a collision code with my float but it isnt working. I know a code that will make it change colors upon collision but taking that to what I want with float is proving harder than I thought. Any suggestions or help would be greatly appreciated.

I have not tried that yet but found a code idea for the door dealing with triggers. Triggers are new for me. I had a brief video show collision changing objects color and making one thing rocket up and keep going up forever but I want to try a trigger float but not sure how to. Scripting is something new to me and I want to figure it out.

Basically instead of OnCollisionEnter you can use OnTriggerEnter

OnCollisionStay OnTriggerStay