emitter bug based on dimensions

I don’t mean to sell Kan’s fix short, but it doesn’t address the root cause of the problem and it will result in the ey part of your equation being ignored.

If you change your equation to:
local dy = ranSign*math.sqrt( math.max( 0, customEmitter.radiusRange*customEmitter.radiusRange - (dx - ex)*(dx - ex) ) ) + ey

Then you will never have a negative square root, which means the rest of your equation will work. It will also make it so that you don’t need to check if the variable is invalid later on. You said you’re not planning on really working on this much as it’s just for your daughter, but replacing math.max with math.abs might be the actually proper fix for this issue.


On a different note, these forums (and the Discord server) are intended to be places where people can ask questions freely about developing games and apps using Solar2D. The first of the official forum rules reads: 1. Be Polite!. There’s no need for anyone to make snide remarks. If you see a post you don’t want to or know how to reply to, or you can’t reply in a helpful or polite manner, you can just let the post be and not reply.

1 Like