- Home /
Question by
max1s · Apr 04, 2014 at 02:53 PM ·
waterwater effects
Example for using water (basic) in C#
Hi Guys:
Working on a procedural generation project where I would like to get water (basic) displaying correctly.
NOTE: I have read link text.
I think the problem is my basic lack of understanding of meshes... but I was wondering if someone could give me a coded example of using:
water.AddComponent<waterSimple>()
At the moment I am using:
public void InstantiateWater()
{
float height = CalculateAverageHeight () ;
GameObject water = GameObject.CreatePrimitive(PrimitiveType.Plane);
water.renderer.material = (Material)Resources.Load ("Water/Sources/Materials/DayWater");
water.transform.parent = GameObject.Find ("myTerrain").transform;
water.transform.localScale = new Vector3 (50f,1f,50f);
water.transform.position = new Vector3 (256f, height, 256f);
water.name = "water";
}
Which obviously doesn't behave correctly because it is using a plane instead of a mesh.
Anyway Thanks in advance
sea.png
(414.8 kB)
Comment
Your answer
Follow this Question
Related Questions
How do I make Stormy water like Temple Run 2 for Mobile? 3 Answers
Trying to achieve this Water effect 0 Answers
Water/Beach foam with unity water 0 Answers
How to make a big 3d ocean? 0 Answers