Makkeonmies
Member
Hey guys, Im trying to have my game pick a random instance of an object (enemypar) and then store that random instance to a variable.
Then, I'd want to refer to that variable in this a statement, for example:
<variable here>.distance_to_object(playerpar) < 100
So that the randomly picked 'enemypar' instance's distance to 'playerpar'-object would be calculated.
Now i can manage storing an object to a variable but it gives me a dead end in the part where i want to refer to that variable in, for example, the distance_to_object() code. How do i refer to it there?
'inst.distance_to_object(playerpar) < 100' for example throws an error.
I want to make it so that if the distance between this random instance of 'enemypar' and 'playerpar' is less than 100, stuff happens.
thanks beforehand!
Then, I'd want to refer to that variable in this a statement, for example:
<variable here>.distance_to_object(playerpar) < 100
So that the randomly picked 'enemypar' instance's distance to 'playerpar'-object would be calculated.
Now i can manage storing an object to a variable but it gives me a dead end in the part where i want to refer to that variable in, for example, the distance_to_object() code. How do i refer to it there?
'inst.distance_to_object(playerpar) < 100' for example throws an error.
I want to make it so that if the distance between this random instance of 'enemypar' and 'playerpar' is less than 100, stuff happens.
thanks beforehand!