How to Access GravityMultiplier from FirstPersonController.cs in UnityScript?

I’m using UnityScript and I want to be able to change the value of GravityMultiplier from the FirstPersonController.cs script from the Character Asset. How would I do this?

You can create a function called SetGravityMultiplier in the C# script that does what you want, then use SendMessage to call it from a UnityScript script. You need to assign the “fpc” varible in the inspector, or using GameObject.Find(), or however else you want to do it.

public fpc : GameObject;  
...  
   fpc.SendMessage ("SetGravityMultiplier", 5.0);  

Be careful though, this can get messy quickly and has poor performance if you do it many times per frame. In general you should keep the same language for all of your scripts so you can call methods directly.