Declaring a Variable based on true or False

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By Nickyroo

Instead of Writing:

var Acceleration = 10
    If Grounded == true:
        Acceleration = 45

Is it possible to write that all in one line? I believe it is possible, but I am unsure, Thanks to anyone who answers

:bust_in_silhouette: Reply From: spaceyjase
var acceleration = 45 if grounded else 10

Thank you, This is heavily Useful :slight_smile:

Nickyroo | 2023-06-06 14:33