- Home /
Aquarium kinda thingy
How can i put water inside cube or some other object(basically an aquarium) and then put some other object in it which have less gravity.
Answer by Arshia001 · Jul 28, 2011 at 10:28 AM
there is no such thing as "water" in 3D graphics, you'll have to play around with transparent shaders and see which one fits the look you're trying to get best. My first guess would be to use a transparent/diffuse shader with very low alpha value.
As for the gravity, give the aquarium a trigger and apply an upward force inside the OnTriggerStay function, something like this:
void OnTriggerEnter(Collider c)
{
if (c.gameObject.rigidbody)
c.gameObject.rigidbody.AddForce(Physics.gravity * -1.2f);
}
Your answer
Follow this Question
Related Questions
Allowing player to swim or dive in water? 6 Answers
color Tint camera 5 Answers
Swimming/Underwater 3 Answers
How to make a lake that you can swim in 2 Answers
How can I fake buoyancy (floating) with a configurable joint (or with a script)? 3 Answers