5 Replies - 1011 Views - Last Post: 09 August 2012 - 02:24 PM Rate Topic: -----

#1 Kreshnic  Icon User is offline

  • New D.I.C Head

Reputation: 2
  • View blog
  • Posts: 12
  • Joined: 13-June 12

Basic Unity

Posted 06 August 2012 - 12:54 PM

I am trying to find a way to create/simulate water in a Unity level. I know this is already in pro but the computer that I am using does not have pro. So far I know I can create a terrain and add a water texture to the terrain, but this only makes that painted terrain look like water. if I was to try walking into it I would simply be standing on the terrain and look like jesus :P. Is there a way without specificaly getting pro to add depth and maybe some simple movement to what I have? I have been searching the Unity site but so far what I have seen requires pro. Any suggestions or hints would be helpful.

Is This A Good Question/Topic? 0
  • +

Replies To: Basic Unity

#2 macosxnerd101  Icon User is offline

  • Self-Trained Economist
  • member icon




Reputation: 10188
  • View blog
  • Posts: 37,629
  • Joined: 27-December 08

Re: Basic Unity

Posted 06 August 2012 - 12:55 PM

Moved to Game Programming.
Was This Post Helpful? 0
  • +
  • -

#3 BBeck  Icon User is online

  • Here to help.
  • member icon


Reputation: 536
  • View blog
  • Posts: 1,193
  • Joined: 24-April 12

Re: Basic Unity

Posted 07 August 2012 - 06:34 AM

My curiosity of Unity has been picking up. I'm about half tempted to load it and play around with it; I'm just afraid it would pull me away from my XNA projects.

Anyway, I haven't used Unity. So, all I can do is guess.

If you can create a non-solid box, you should be on your way. What I'm thinking is something like this:

You have your terrain. Let's say it's hills and valleys and you want just one valley to contain a lake. Let's say you can define a plane with a water texture on it and place it into that valley, so that visually it looks like a lake. If it has no collision detection it should allow you to walk to the bottom of the lake, which is what you want at this stage. When you're "under water" you will either look up and see the water texture above you or see sky and the water texture will be invisible depending on whether back face culling is turned on.

You could theoretically even annimate this texture so that the water appears to be "flowing".

Now the problem here is that it's not really "acting" like you're under water.

So, the next step of my plan is to put a collision box right under the water plane that covers the entire underwater area. This is a "collision box" in that it detects collisions, but it's not solid or visible during actual game play.

Anyway, when the camera is inside of the underwater collision box, the code has to tell the camera to turn on green "fog". You are probably already using fog at the edges of the scene. Here you want the fog to be thick enough to make it look like being in a lake. And visibility should be less than about 10 meters.

I'm a scuba diver who's done a lot of lake dives. Usually you can see somewhere between 2 and 10 meters. And it tends to get darker and darker with depth, depending on the visibility. Usually by 20 meters depth it's pitch black.

Anyway, you could also have the underwater collision box change the state of the player to "swimming mode" rather than allowing them to walk as normal under water. You really want the player's movement to feel like swimming and also have a bouyancy that is almost like flying until the reach the surface. Then you need them to bob up and down in the water.

You also may want to play underwater and swimming sound effects.

I don't know how much of this Unity would allow you to do, but that's the approach I would go for.
Was This Post Helpful? 1
  • +
  • -

#4 Tayacan  Icon User is offline

  • D.I.C Regular
  • member icon

Reputation: 145
  • View blog
  • Posts: 275
  • Joined: 18-January 11

Re: Basic Unity

Posted 07 August 2012 - 07:31 AM

Unity lets you do all of what BBeck described - making a box or plane that you don't collide with is easy (just right click the collider component and remove it), or you can turn it into a trigger - that is, a collider which detects collisions, but doesn't use them in physics calculations.
Was This Post Helpful? 1
  • +
  • -

#5 Kreshnic  Icon User is offline

  • New D.I.C Head

Reputation: 2
  • View blog
  • Posts: 12
  • Joined: 13-June 12

Re: Basic Unity

Posted 09 August 2012 - 10:55 AM

It works wonderfuly. Thanks for the tips and sory I took a while to reply.
Was This Post Helpful? 1
  • +
  • -

#6 BBeck  Icon User is online

  • Here to help.
  • member icon


Reputation: 536
  • View blog
  • Posts: 1,193
  • Joined: 24-April 12

Re: Basic Unity

Posted 09 August 2012 - 02:24 PM

View PostKreshnic, on 09 August 2012 - 11:55 AM, said:

It works wonderfuly. Thanks for the tips and sory I took a while to reply.


Awesome!
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1