Can I make variables depend on eachother before running the game

Hello,

I’m using this function

AnimationCurve EaseInOut(float timeStart, float valueStart, float timeEnd, float valueEnd);

how can I achieve something like this:

public float x;
publix float y;
public float z;
public float w;

AnimationCurve EaseinOut(x, y, z, w);

so when I click the animation curve editor before running the game, the length and height of the graph will depend on the values I put in in the inspector.

Unity says ‘Assets/DOOR SCRIPT/SCRIPTS/Door.cs(16,70): error CS0236: A field initializer cannot reference the nonstatic field, method, or property `Door.x’’

but is there any workaround?

Does this help at all?

I’m not sure what you’re asking, but give it a shot and see if that works :smiley: