I had set a wave blast that is to follow a sprite, it’s basically the concept of a ray gun, but it’s getting pushed around the screen even though I have it set to static, the other objects also in the physics engine are forcing it out of the way, is there any way to still have it on the physics engine so I can register collisions (so enemies can be killed) or will I have to basically check if an enemy is within the coordinates of the wave, making a really bad hitbox? (would be fine if it was rectangular but it’s wave shaped)
Got it, I just followed a bad tutorial,
wave.bodyType = ‘static’
doesn’t seem to do anything!
so when I added it to the engine via physics.addBody(wave) it was setting it as dynamic instead of physics.addBody(wave, ‘static’)
Hi @lf2owner,
Just a quick note: you can set any physics body as a “sensor” to make it detect collisions but not get moved or forced around physically as a result of collisions. That body can be basically whatever you want: a rectangle, a circle, a shape, etc.
https://docs.coronalabs.com/api/type/Body/isSensor.html
Take care,
Brent
Got it, I just followed a bad tutorial,
wave.bodyType = ‘static’
doesn’t seem to do anything!
so when I added it to the engine via physics.addBody(wave) it was setting it as dynamic instead of physics.addBody(wave, ‘static’)
Hi @lf2owner,
Just a quick note: you can set any physics body as a “sensor” to make it detect collisions but not get moved or forced around physically as a result of collisions. That body can be basically whatever you want: a rectangle, a circle, a shape, etc.
https://docs.coronalabs.com/api/type/Body/isSensor.html
Take care,
Brent