=
EDIT: I have either solved or found a work around for this by scaling up the objects in question after seeing mention of something vaguely related elsewhere. But if that is the fix that leads to another question: why does scale break physics?
I'm making an extremely simplistic breakout model at the moment but the 2D physics refuse to work as I'd expect.
Objects in question at the moment:
- square 'ball' with 2D box collider
and rigid body 2D
- rectangular 'block'
with 2D box collider
Both are set to:
- 0 friction
- 1 bounciness
'Ball' is set to:
- 0 gravity
- 0 angular drag
- 0 linear drag
- 1 mass*
- freeze rotation Z
- "is kinematic" is off
*I've tried many magnitudes of difference here with changes to the applied force to match. No matter what the scale, the same speed has the exact same effects as described below.
When the game starts I add a force to the 'ball' and it travels towards the block. The collision is detected fine and I'm able to script destroying the block. The 'ball' loses all velocity on the Y axis, but continues to move using only the X axis portion of its previous velocity. On hitting the edge of a second block it again triggers the collision*, destroys that block as well, but loses all velocity on the X axis as well.
*to be clear using OnCollisionEnter2D
Oddly it seems to work perfectly fine when the initial velocity is higher, though it is not remarkably slow right now.
This same thing happened the last time I tried to use Unity's built-in physics. I tried to code the physics directly myself with 'is kinematic' (again this is now off) but would like to learn how to use Unity's system.
What am I overlooking?
↧