chances are its more a problem of public missing.
in JS all is public by default and you must declare private but in C# all thats not specified differently is private
using UnityEngine;
using System.Collections;
public class test : MonoBehaviour {
public float val;
public void CallMe( float time )
{
Debug.Log("Time: " + time);
}
}
thats my test class you can use. I can animate val, as well as I can output a value through callme when I create an animation event and select the function.
potentially you made the error of not extending from monobehavior which is a no go
Thanks! It’s workin’
The problem was that I thought no variable needed to be defined, and the Animation editor would call the function using the curve as the input variable… :lol: I’ve been silly.
the val is actually not required. you can call the function on any animation curve as an animation event, even if you transform the objects position for example.
when 2.6 was new I did a little camera flythrough with the editor and scripted actions, just to get a hang for it.