27-11-2020, 04:04 PM
(This post was last modified: 27-11-2020, 04:11 PM by josemendez.)
hmm.. I get the impression that you don't understand the code at allĀ
This line makes no sense whatsoever. You're comparing objects of different types (which won't ever be equal to each other). "emitter" is of type ObiEmitter, and "player" is of type ObiCollider2D. A emitter is not a collider, so this will always be false.
Moreover, you've declared the emitter variable twice: once as a public member of the script, and another within the Solver_OnCollision method. This script won't compile.
At this point I should really insist that you invest some time learning basic programming, as I can't possibly handhold you trough every line of code you write. Not that I have anything against helping you, it's just that I don't have the resources to do that. This forum is for help with Obi-related issues only.
(27-11-2020, 04:00 PM)JoseCarlosĀ S Wrote: if (collider == player && emitter == player)
This line makes no sense whatsoever. You're comparing objects of different types (which won't ever be equal to each other). "emitter" is of type ObiEmitter, and "player" is of type ObiCollider2D. A emitter is not a collider, so this will always be false.
Moreover, you've declared the emitter variable twice: once as a public member of the script, and another within the Solver_OnCollision method. This script won't compile.
At this point I should really insist that you invest some time learning basic programming, as I can't possibly handhold you trough every line of code you write. Not that I have anything against helping you, it's just that I don't have the resources to do that. This forum is for help with Obi-related issues only.