crazy physics bodies

Hey all, for this post I have 2 questions:

1.) is there a way to make a physics body get smaller along with the image it is associated with?( like an object going far away{shrink} then coming close{grow})

2.) I have two objects that are just floating around on my screen. At the beginning of the scene I give each a linear impulse so as to make them bounce around the screen. Only problem is if I stay on the menu, after a few minutes the objects will start going crazy.(i.e. spinning out of control, bouncing around a ridiculous speeds)

Much appreciated,
J.K. [import]uid: 66117 topic_id: 17384 reply_id: 317384[/import]

  1. From what I’ve read, you can’t change the dimensions of a physics body once it’s been created. You have to create a new one, then delete the old one.

  2. Not really sure about that one. Have you changed the physical properties of the body from the defaults (like bounce)? [import]uid: 89724 topic_id: 17384 reply_id: 65840[/import]

1.) Well that is a feature they need to get…

2.)Yea, I tried that. But the settings I have currently are exactly what I want. changing them messes the objects up, either making them bounce like a particle of steam, or go “thud” against the wall like an oval-shaped ball of uranium the size of an elephant. [import]uid: 66117 topic_id: 17384 reply_id: 65841[/import]

Question 1 x2495iiii is correct.

Question 2 - have you tried obj:getLinearVelocity()? You could do that then if it is higher than X amount, set it back down.

Peach :slight_smile: [import]uid: 52491 topic_id: 17384 reply_id: 65894[/import]

I was under the impression that getLinearVelocity didn’t work unless a linear velocity was applied in the first place. In my app, using a linear impulse or a linear force on a physics body yielded a linear velocity of 0, 0. Since he used an impulse, wouldn’t it return 0, 0? [import]uid: 89724 topic_id: 17384 reply_id: 65935[/import]

@ Peach,
No, I haven’t tried that. I’ll give it a shot.

Much appreciated,
J.K. [import]uid: 66117 topic_id: 17384 reply_id: 65941[/import]

Actually x2495iiii is correct, my apologies - you could still do this (effectively) by checking how fast the object is moving using your own method. (Checking positions, etc.)

Else you could apply linear velocity rather than impulse if that would work in your situation in order to simplify the process.

Peach :slight_smile: [import]uid: 52491 topic_id: 17384 reply_id: 66168[/import]