What happened here?

I guess fixed rotation is not so fixed after all:

I created each of my fireballs with fixed rotation, but apparently, this special one proved otherwise.

https://youtu.be/NaNhZ1X3HoY

I am using applyLinearImpulse for the collision with the sensor. Any help would be appreciated, thanks!

This is odd. One thing that has “bitten” users several times in the past is that they apply “object.isFixedRotation = true” before they add the physics body to that object. In that case, physics will not “look back” to that property and make the body fixed rotation… thus, it’s imperative that you apply that property after the object is made into a physical object (“physics.addBody()”).

Brent

@Brent That makes sense as it is a property applied by the physics API, so it seems reasonable that any value supplied before a body is applied would get overwritten when addBody is called.

My thought was the classic “isFixedRotation=true is incompatible with joints” problem, though I can’t remember if that problem was solved (and I’m not in a position to check, right now.)

Seems to work now. Thanks!

I added a big loud warning to the docs on this point, since you’re not the first developer to have been bitten by this. :slight_smile:

https://docs.coronalabs.com/api/type/Body/isFixedRotation.html

Brent

Now developers in the future won’t have this problem. (☉◞ ☉)

This is odd. One thing that has “bitten” users several times in the past is that they apply “object.isFixedRotation = true” before they add the physics body to that object. In that case, physics will not “look back” to that property and make the body fixed rotation… thus, it’s imperative that you apply that property after the object is made into a physical object (“physics.addBody()”).

Brent

@Brent That makes sense as it is a property applied by the physics API, so it seems reasonable that any value supplied before a body is applied would get overwritten when addBody is called.

My thought was the classic “isFixedRotation=true is incompatible with joints” problem, though I can’t remember if that problem was solved (and I’m not in a position to check, right now.)

Seems to work now. Thanks!

I added a big loud warning to the docs on this point, since you’re not the first developer to have been bitten by this. :slight_smile:

https://docs.coronalabs.com/api/type/Body/isFixedRotation.html

Brent

Now developers in the future won’t have this problem. (☉◞ ☉)