Multiple actors and Accessed none

Hello !

I have been searching but in vain…
I have 2 actors types: “cellule” and “Solution” in which is stored the variable “Glucose”

Basically the actor “cellule” retrieves the variable Glucose and multiply it to get another variable “pATP”
When only 1 cellule is on the map everything works fine, pATP is not null, but when I add another cellule only the first one has access to the variable Glucose and I have the error : Accessed None trying to read property Solution

Any idea ?

Thank you for your help !

Ok so I guess the second pic is the cell, how does it get the variable solution?

Yes the second pic is from the cell. In the cell BP the variable is accessed only with Solution → Target c Solution Glucose.
And it works perfectly as long as there is only 1 cell!

I rearrange my question, where do you take the reference for Solution?

Ok I see what you mean.
At first I was testing only one cell on the map and did not used “cast to” because it worked without it and I had an error (don’t need to cast).

I added back "cast to"on the BP, set a local variable inside the cell and now it works :slight_smile:

Do you have an explanation why it worked without casting with only 1 cell and not more ?

Thanks a lot for your help and quick answers !

hello thibaut,
ici avec le noeud “get” tu ne prend que le premier resultat de "get all actors"si tu veux avoir tous les objets, il faut utiliser une boucle for afin de traiter tous les resultats.

//

here with the “get” node, you’ll only get the first result from the “get all actors” if youwant all the objact, you may want to use a for loop

Salut ! Merci pour l’info ! Je n’ai qu’un élément alors ça passe comme ça…