Object bounces around as if in water
I want behaviour of an object as if in a tank, as if bouncing around in water
Basically I am trying to create something like this https://www.youtube.com/watch?v=HA3cr4-Fadw
I think, I don't need to create actual water in this. Only illusion of movement in water is enough for me. Can you give me more suggestion to achieve this kind of stuff?
That is very, very difficult.
Note that "water" packages for Unity "merely" mean simulating the surface of some water.
I believe you actually want to SEE THE WATER in a fish tank "from the side" right, including sloshing.
This sort of thing - for example in CG movies, etc - is done with a "multi-physics" package such as Bullet Physics http://bulletphysics.org/
It really has nothing to do with game engine -type physics (like PhysX in Unity).
It's very likely you'd have to make a simplification of your issue and work on that
NOTE the op has explained they DO NOT WANT TO SEE THE WATER, they only want to see AN OBJECT IN WATER, that is to say acting buoyant.
Answer by Fattie · Jan 11, 2016 at 03:35 PM
Fortunately this is very simple.
Make a cube, now make it "flat",
so for example 10cm long (that's 0.10 units, you must use natural one meter units), 8 cm deep and say 1cm thick.
Make six of these so that you form a "box", just as in your example.
On the one near the camera, simply eliminate the renderer, so of course you can see through it.
Put a ball inside.
Be sure to turn on gravity. In the first instance just sit the ball at the top and hit Play, notice it bounces down correctly.
What you must now do is make it so that when you turn the phone around, the box turns around.
You will find 1000s of QA about this on here, just google.
It will now work perfectly as you spin the phone.
There's only one more thing to do:
(1) add some drag to the rigidbody of the ball
(2) change gravity setting (likely, lessen gravity)
You may or may not need to do one more thing. Simply add a random small force, either "left" or "right" which has a random size and goes off randomly every about .75 seconds. You'll find that looks exactly like inside-water motion.
Enjoy!
NOTE...
Also, be sure to simply look in the asset store, and on free wikis etc, for simply
A BUOYANCY PACKAGE
if you can find a "buoyancy" script or asset, you're done. Just (1) attach the buoyancy script to your ball. (2) do what I mention above about "turning the object over when the phone turns over"
Enjoy! Aacha
Thank you so much for all this, sir. Sorry for some of my misleading content previously.
no problem, hope it helps. also see my edit.
PS the shader is irrelevant here. use any shader you like that looks good. I very strongly suggest using Unity5 here, do not start with Unity4.
"On the one near the camera, simply eli$$anonymous$$ate the renderer, so of course you can see through it."
Look at the Inspector
. Look at the component called $$anonymous$$eshRenderer
. Look at the top left. There is a check-box. Turn the check off.
Of course you have to do this, or, you camera will not be able to see-through that "wall"!
Create six walls (use "flat" cubes) to make the box. Of course, make the "front" wall invisible so the camera can see through it.
Okay Thanks!!
Next time reply me please :)
Right now I have to use google for this.