Converting Event To Function Not Working With Object Groups

Greetings,

I have an event that is working correctly when fired, however I wanted to convert it to a function. Normally this is not a problem, however it does to seem to be able to access object variables when being called from the function. (I did check, the function is being called).

For a “work around” I can add this logic to an external event and link it when it need to be fired, but I feel a function would be best.

Groups

  • projectiles (contains sprite objects)
  • usable_weapons (contains sprite objects with variables (all the same variables))

Code that is working in the event

Same code but as a function and not working


Object Variables

I am facing an issue like yours. In events my events all work , but when exported as a function , or even writed manually as a function , they behave odd . I wonder could you figure out a solution to your problem. İf so , what was that ?

I didn’t really spend much more time on it sorry. The work around I am using is having the logic in an external even and just calling it when required. For example:

1 Like