1

I want to send a vector value from script to the editor (in order to change the spray angle of an emitter). What is wrong with the line

Patches.setVectorValue('sprayAngle', Reactive.pack3(0, 0, 0)); ?

It marks an unknown runtime error at the first parenthesis. I suppose, there actually needs to be a Vector as the second argument (and not VectorSignal), but how do I create a custom vector? There is afaik nothing like new Vector() in Spark AR. Sending boolean and scalar values is no problem though, the problem is just with sending Vector or Point. I am somewhat confused with these signals/non-signals, Vectors/Points.

Coatl
  • 542
  • 3
  • 6
  • 19
  • 1
    I think it's `Reactive.vector(0, 0, 0)` - docs here https://sparkar.facebook.com/ar-studio/learn/reference/classes/reactivemodule - actually, no. Docs say it needs to be a `VectorSignal`, which is `Reactive.VectorSignal(0, 0, 0)` - docs here https://sparkar.facebook.com/ar-studio/learn/reference/classes/patchesmodule – Sergiu Paraschiv Jul 22 '20 at 15:53
  • That's it! `Reactive.vector(0, 0, 0)`. Thanks! (`VectorSignal` doesn't work.) – Coatl Jul 22 '20 at 16:10

1 Answers1

0

So, as Sergiu Paraschiv already mentioned in the comments, it needs to be

Patches.setVectorValue('sprayAngle', Reactive.vector(0, 0, 0));
Coatl
  • 542
  • 3
  • 6
  • 19