Set CharacterMotor Gravity Script?

Hi, I’m using the CharacterMotor script that comes with Unity. I’m also mostly using PlayMaker to set up my character. Anyway, It seems like I am unable to access the gravity parameter of the CharacherMotor component with PlayMaker.

My question is; is it possible to make this parameter accessible with PlayMaker, or should I write a script?

For example, I have a water zone trigger, so ‘on trigger enter’ I’d like to lower the gravity value. I wrote this script but it doesn’t work:

using UnityEngine;
using System.Collections;

public class WaterEnter : MonoBehaviour 
{
	void OnTriggerEnter(Collider other)
	{
		CharacterMotor gravity = other.gameObject.GetComponent<CharacterMotor>();
		if (gravity)
		{
			gravity = 10;
		}
	}
	
}

In the CharacterMotor script, the gravity is a field in the variable movement (whose type is CharacterMotorMovement) - you must thus get the script and modify its movement.gravity variable:

using UnityEngine;
using System.Collections;
 
public class WaterEnter : MonoBehaviour 
{
    void OnTriggerEnter(Collider other)
    {
        CharacterMotor motor = other.GetComponent<CharacterMotor>();
        if (motor) // if "other" has such script...
        {
            motor.movement.gravity = 10; // set its gravity
        }
    }
}

NOTE: CharacterMotor is a JS script compiled in phase 1; your CS script must be compiled in a subsequent phase in order to be able to access it - take a look at Script Compilation Order in the docs.