# Gravity activation based on an expression.

## Recommended Posts

Posted (edited)

Hi just wondering if any one could give me any advice on how to write an expression which would set the gravity to 1 for the first 30 frames, back to 0 for until 180 where i would turn back on. At the moment i have if(\$FF >= 30,0,1) which sets the first 30 frames to active but I'm struggling with re-activating it at frame 180.

Any help would be appreciated.

Edited by PortalPyro98

##### Share on other sites

Stupid question: Why don't you just keyframe it?

##### Share on other sites
18 minutes ago, Whatsinaname said:

Stupid question: Why don't you just keyframe it?

Just looking for ways to make the process more efficient.

##### Share on other sites

I would:

(\$F<31)||(\$F>179)

Each side of the logical OR evaluates to "1" when they're true.

15 minutes ago, Whatsinaname said:

Stupid question: Why don't you just keyframe it?

To save a couple clicks? To practice expressions? For fun?

But yes, keyframes are the quickest and easiest way to animate in general.

• 1

##### Share on other sites
2 minutes ago, kleer001 said:

I would:

(\$F<31)||(\$F>179)

Each side of the logical OR evaluates to "1" when they're true.

To save a couple clicks? To practice expressions? For fun?

But yes, keyframes are the quickest and easiest way to animate in general.

Oh cool thanks a lot, yeah I'm just trying to use expression's where possible to help me learn but i understand that in this case key frames would be a lot similar and probably faster. Thanks anyway.

## Create an account

Register a new account