hi everybody,
I need help with what seems to be a fairly easy task. I think I could manage programming it myself but looking at my (unfinished) attempts made me think there has to be a more elegant, more efficient way.
In my scene there is a box trigger (a cube, no mesh, no rigidbody), let’s call it bounding box for now. I have some smaller rigidbody objects which can be picked up and carried around by the player. When the player moves one of them near the bounding box and it touches it, the object should float around within that bounding box (on all axis) in a random manner but never leave the bounding box (unless the player later comes back to pick it up from within it).
How would you go about that? Is the approach of using a box trigger good at all? What functions should I use to achieve a random movement within that cube (or otherwise predefined) volume? Should I apply forces to the smaller objects or have some sort of paths within my bounding box they would move along?
Thanks a heap for sharing any ideas or hints.
kind regards, stefan