Hi there,
I was wondering if there's some easy way in DS to declare a number variable with min and max values, just from the interface, so I don't need to resource to external code to clamp its value periodically...
If not, I use PlayMaker so I guess I could make a 'watcher' FSM, but that solution doesn't ring just right, performance-wise, to me (I think).
Thanks.
"Clamped" number variables?
"Clamped" number variables?
Unity 2019.4.9f1
Dialogue System 2.2.15
Dialogue System 2.2.15
Re: "Clamped" number variables?
There's no built-in way to automatically clamp to min and max values.
I agree that a 'watcher' FSM wouldn't be the most efficient solution. But then again it might not be an issue if you only check, for example, at the end of conversations.
Depending on how you change the variable's value, you could register a custom Lua function to set a variable with clamping, or do the same with a PlayMaker action.
BTW, if you're using the Increment On Destroy component, it clamps, so you don't need to do anything special for it.
I agree that a 'watcher' FSM wouldn't be the most efficient solution. But then again it might not be an issue if you only check, for example, at the end of conversations.
Depending on how you change the variable's value, you could register a custom Lua function to set a variable with clamping, or do the same with a PlayMaker action.
BTW, if you're using the Increment On Destroy component, it clamps, so you don't need to do anything special for it.
Re: "Clamped" number variables?
Ok, no problem. I'll go for the 'clamp everything' approach at the end of conversations.
Thanks for your quick response!
Thanks for your quick response!
Unity 2019.4.9f1
Dialogue System 2.2.15
Dialogue System 2.2.15