How to grow a physics body?

I checked the other thread on this board and didn’t really understand the answer… I’ve got this ball that I want to grow for a certain period of time when it collides with a special ball. So I’ve got everything done, except growing the physics body. I tried wrapping the addBody function in a function that I call inside the collision function. But this wont work… Anyone knows how this is achieved?

Thanks in advance, [import]uid: 14018 topic_id: 5462 reply_id: 305462[/import]

you can’t grow physics bodies, and addBody inside a collision will crash the system

remove your original, set a flag to say you need to spawn a new body, then add the new body in your enterframe

[lua]local spawnBallSize

local function onEnterFrame(event)
if(spawnBallSize~=nil)
spawnBallWithSize(spawnBallSize)
end[/lua] [import]uid: 6645 topic_id: 5462 reply_id: 18425[/import]

Thanks for your reply. I didn’t quite understand your post, which code is the one to “remove” the physics body and which one is the one that creates a new and bigger one?

Thanks, [import]uid: 14018 topic_id: 5462 reply_id: 18562[/import]

ops double [import]uid: 14018 topic_id: 5462 reply_id: 18563[/import]

it isn’t. you can find that stuff in the examples included with corona.

i was just showing you where you would create a new body. [import]uid: 6645 topic_id: 5462 reply_id: 18595[/import]