Hi,
I am storing the rigidbodies of three gameobjects in three variables.
var ki1 : Rigidbody;
var ki2 : Rigidbody;
var ki3 : Rigidbody;
I assigned them on the editor. After that, I stored the variable names in an Array (ki1, ki2, ki3).
I shuffel them and go through that array. But when I try to put an Addforce to them (like: array*.AddForce(3000.0, 0.0f, 0.0f) unity tells me “‘AddForce’ is not a member of ‘Object’”.*
I do understand the problem as “ki1, ki2 and ki3” are just strings. How do I workaround that? I am not really sure how to achieve that. Isn’t it possible to just store the variables in an array and call its items by its variable name?
Thank you