CVROSC icon indicating copy to clipboard operation
CVROSC copied to clipboard

Bools

Open Greendayle opened this issue 2 years ago • 5 comments

Bools seem to be ignored, but it's working properly when I send bools as float (0.0/1.0). For compatability with VRC tools, maybe it's worth to autoconvert bool to float?

Greendayle avatar Aug 01 '22 22:08 Greendayle

Confirming this. Both Bools and Ints are ignored in the switch case. Since there's no code but the type is still specified it doesn't error out in console so there's no indication that the data is not getting passed.

        {
            switch (Data)
            {
                case bool b:
                case int i:
                case float f: [...]
            }
        }

geepot avatar Aug 02 '22 19:08 geepot

I forgot to change the cast to an actual convert function! I'll replace it with Convert.ToSingle(Data); now.

KaleidonKep99 avatar Aug 02 '22 19:08 KaleidonKep99

Will this work with non-float parameters in Unity as well or does the target parameter in unity have to be a float? Sorry if this is a dumb question. Haven't had time to do a full review of the code yet.

I am planning to rework my animator to floats regardless to take advantage of the larger parameter memory allowance to do some things I couldn't before, but it would be nice to have my existing animator working as a stopgap while I'm making those changes.

geepot avatar Aug 02 '22 20:08 geepot

It should work anyway, since any object (integer, boolean, double, even float itself lol) passed to Convert.ToSingle will be converted on runtime.

KaleidonKep99 avatar Aug 03 '22 08:08 KaleidonKep99

1.6 should have the fix in place, let me know if it works.

KaleidonKep99 avatar Aug 03 '22 14:08 KaleidonKep99