So I’m relatively new to Defold and have a feeling this is a noobish mistake - I’m trying to send a message to another script - which is working - however the message is being sent infinitely, and as such the temporary “print” that I put in there is constantly sending.
In other words, I’m sending a limited number of messages however it is being received infinitely.
elseif action_id == hash("test") then
msg.post("spawnerRight#spawnNPCS", "leftMove")
end
and on the spawnNPCS script
if message_id == hash("leftMove") then
print("5")
However all I’m getting is an infinite loop of “5” in the console despite only sending a single message.
I’m sure this is just an issue of me not understanding the way messages work within Defold, but I can’t find any help on this issue anywhere, and it seems to be quite an easy to make mistake haha.
Thanks in advance!
So I did as you recommended, however it’s still sending an infinite number of prints.
elseif action_id == hash("test") and action.pressed then
msg.post("spawnerRight#spawnNPCS", "leftMove")
end
I’m still getting this though
It also isn’t just hitting a large number and stopping, it’s doing something I can’t describe with images which is constantly cycling between 900 and 999 constantly.
Any help would be nice lol.
So after opening Defold again to look it over it’s now working when I’m running it - I don’t know why it took me restarting defold for it to work and why rebuilding it didn’t do it, but atleast it’s working.
Thanks @britzl for the advice, will do so next time I have an issue I don’t really use forums of any kind but thought I’d give it a try as I was desperate for a solution, so didnt really know what to do lol.
Thanks for being patient with me guys