Hi,
I’m pretty new to defold and I’m creating a little asteroids clone to get the grasp of it. I come from a strong OOP background so, sometimes I struggle with some defold patterns but I have been able to overcome them until now :).
I have a starship that has weapons. The starship can can have several weapons active at the same time. The weapon creates the bullets and track and move them iterating through a table.
So, when a bullet hits a target, it must communicate to the weapon that it is done and that it can be removed/deleted from the scene. This, that sounds pretty simple is what I’m struggling with.
My question would be, how can I make the bullet know about the weapon it has created it to be able to message the weapon about collision or call the needed script function directly from the bullet?
I have tried to use property.set on the bullet from the weapon, but it needs an url to the object and I have an id (the id that is returned when the bullet is created with a factory).
Thanks in advance!