Hi, I'm using the Character Motor component that comes with Unity, and I really need to be able to change the gravity setting with Playmaker. I've tried a few things but haven't been able to make it work.
I've written a c# script which is great for basic things, such as on trigger enter, but I'm not great using scripts to do more intricate work. It would be great to be able to set this parameter with Playmaker.
This is my script.
using UnityEngine;
using System.Collections;
public class Gravity : MonoBehaviour
{
void OnTriggerEnter(Collider other)
{
CharacterMotor motor = other.GetComponent<CharacterMotor>();
if (motor) // if "other" has such script...
{
motor.movement.gravity = 5; // set its gravity
}
}
}
Could I write a script that just straight up gives me access to the parameter in Playmaker, or perhaps even write an action script?
Thnak you!