How do I get the average value of my object variables with different values

I created an object variable for my laser object to collect time(a value). And each does their own thing and I’m ok with that. Now I’m trying to collect the average for that scene using an expression because they output different object values.

1 Like

A basic average is the sum / number of numbers.

You could use for each instance to go through the objects and add the variable value and then divide the sum by either the number of that object in the scene or the number picked if you only need an average of the picked instances.

My result

If the values were in an array. The array tools extension has an average function.

3 Likes

Okay i understand your concept.Thanks, the Sum variable you created is local right?

Yes. I was just using local variables. It’s easier to screenshot. The variables can be anything. If you don’t use local then don’t forget to reset the sum variable to 0 before each time.

2 Likes