Rigid Body simulation. Help!

Hi all, I’m trying to make a rigid body collision with a lollipop and a floor. I’m currently using the game engine, but it treats it as a cube/sphere/cone. Any way i can tell the engine to treat it as the object that it is? I tried using softbody collision - but the end result is always the thing collapsing in on itself, which is not what is supposed to happen. Any suggestions on making it work? Or another way for the collisions to work? Thanks! Speedy replies are much appreciated!

Model a simpler object with as few vertices as possible that is your game logic rigid body, to use in the simulator, then set this object not to render, and parent the real lollipop to the logic object. This should work with box bounding, but if not, try triangle mesh for your collision bounds.

I’m not making this for a game, rather making use of the game engine for some physics animations. If I made a simpler object such as the cube, then it defeats the purpose? I suppose another way is to model a simple cube with a cylinder/cuboid attached. Would that still work?

I know it’s not for a game. You can still model a simpler object to use in the game logic, one that has the same dimensions as your real object but without all the subdivisions. Then you set that object not to render at all in your animation, but it has all the IPO curves generated by the game logic. You parent the real object (your lollipop) to the logic (non-rendered) object, so that it moves exactly like this logic object. I used this method to do exactly same thing you’re doing, except it wasn’t a lollipop, I was dropping 7 battle axes onto a floor.

Oh ok. I think I get what you’re saying. But with a simpler version is that it’s similar to a cone, so i set it as a cone, but it’s only correct at a certain angle. If you drop it with the stick pointing up, in real life, the lolly will become rested with the stick touching the floor. But with a cone, it’ll land on the flat surface, and then not move. For the simpler version, do I use a cylinder? or do I use a sphere/cube attached to a cuboid/cylinder? And what bound shall I set it to in the logic tab? Thanks for the replies

Without seeing your scene it’s hard to say, but here is a guess.

  1. Move your real lollipop out of the scene for now.
  2. Add a circle (space add mesh circle) with maybe 16 vertices and set to fill.
  3. In edit mode, select the whole circle and extrude (E) region to roughly the width of your real lollipop.
  4. Scale down this circle to the size of your lollipop.
  5. Extrude one of the new faces along the edge of the circle to make the lollipop handle. Scale this down to match the size of your real lollipop handle, or maybe slightly smaller/narrower.
  6. OUt of edit mode, recenter this object with space -> transform -> centre new.
  7. Make this fake lollipop a rigid body actor in the game logic.
  8. Try setting bounds to “Box”.
  9. Make your floor a static actor with bounds set to box in the game logic.
  10. Press ctrl-shift-alt-P to record game logic to IPO at the frame rate set in the render panel for the start/end frames that you want to simulate.

If all this looks right, then go back to the start of your animation, move the real lollipop directly onto your fake lollipop, exactly aligned for location/rotation. Parent this real lollipop to the fake one, then set the fake one not to render.

You will have to experiment. I always set physics to maximum substeps in the world panel (physics tab, phys: 5; subs: 5) for best results. You may need to change the radius setting of your fake lollipop in the game logic (smaller), especially if you have more physics objects nearby.

If it doesn’t look right, you may have to set your bounds to triangle mesh instead of box. Alternately, you may have to have separate objects for your fake lollipop and the handle, which would be the same process, except you parent the fake handle to the fake lollipop and you click “compound” in the game logic for the fake lollipop so that the physics connects both these objects together and computes them as a single physics object with multiple parts.

If your fake lollipop falls and lands on the floor but stays perfectly upright, making a small change to its initial position so that it is slightly on an angle instead of 90 degrees perpendicular to the floor, and then it should topple and bounce and eventually settle.

Ultimately the point is, you can do all your game logic with a simpler object to get your physics right, and it may be impossible to get your physics right using your real object only, depending on how its constructed. You may need several fake objects parented together to get the physics working how you want them, but once they do, set them all not to render, and parent the real object to the physics one.

If you can’t get it to work, maybe you can post a blend file.

Thanks, I’m trying that out now.

Brilliant, it works now. Just one slight problem: it calculates many many object collisions in the game engine, but when I write to IPO, only 9 objects out of the original 32 are left after the simulation :confused:

I don’t understand what that means, but if it works, you’re basically there and it’s just tweaking. Make your fake objects slightly smaller than the real objects and it will look in the animation like they are hitting the obstacles.

Dark-Myth: check those Ipo blocks. Make sure that you don’t have multiple sets of objects linked to the same Ipo. That would make them appear to disappear after the sim, because several objects having the same Ipo block would be animated exactly on top of one another.

Thanks for that, my screen is dead small so I didnt realise there was an IPO datablock assigner. Gonna do that now, and update you guys on the thing when it’s done.

Thanks Harpyman, works like a charm :slight_smile: just adding the materials now… What is the IOR of a lolly i wonder…

It’s “harkyman”… but you’re welcome. That one still nails me from time to time.