Access function from other object's script

Hi All,I’m newbie on Unity.
I just wondering how I can access a function of a script which already attached on one object through other script.

It seems like I have a script named script1
which has a function named play()
function play()
{
}
I attach it to my avatar.

Also I have a GUI object which attached script2

in this script2,I want to call script1’s play function.
Are there any ways I can do that like

function Update()
{
if(true)
{
script1.play()
}
}

I don’t know how to do that!
Pls help me ,Thanks a lot !!

Read the docs. :slight_smile: It’s right in the section about accessing other game objects. Also, there are a billion topics already in this forum about it if you do a search.

–Eric