Unity3D with Tanner Netterville

33 views
Skip to first unread message

Chang Lee

unread,
Aug 23, 2018, 10:27:05 PM8/23/18
to Penny University
A Unity3D Penny Chat

I've been working on a Unity lake simulator for a side project.As a Unity noob, there are two questions after I finished a few tutorials that I feel will take a long time to figure out. 

1. How do I calculate the distance between the boat and the terrain (shores, trees etc)?
2. How do I save the camera view to file?

So I set up a Penny chat with Tanner. The chat saved me at least 20 hours of research time. Here's how.

Question 1: finding distance

For question 1, he showed me that I can calculate distance between objects by a method called raycasting which is common in older FPS games. 

The idea is that you can attach a laser pointer to a game object, and the output of this laser pointer includes the distance, parameter, where it was it etc. This is how FPS games determine whether there is a hit or not! I had no idea it existed.

Once I modeled the terrain, I can set up a raycast object from the camera to get the distance between camera and the terrain. This is perfect! But there is a little catch - because the rays are stopped by colliders, I need to set the layer masks so the rays can penetrate the right objects. 

(Live coding footage from Tanner -> I didn't know about the bitwise operator thing <<)

s2_cropped.png




Question 2: render to image

For saving camera view to object, he showed me this thread:

Basically, render the view to texture, then convert to Texture2D, and finally, call the encoding to image methods.

Now I just need to figure out the right frame rate, and a good way to record the distance along with the images (maybe code it into filenames?)

Other tips

I was having navigating inside my Scene View in the Unity Editor. Tanner says the shortcuts he used the most are

* Left click to select
* Right click to rotate
* Middle click to drag the view
* Alt left: Drag camera on orbit
* Alt right/mousewheel to zoom in or zoom out.

This is incredibly helpful to me because I spent quite some time setting up the right perspective to work on the objects.

PS. After Tanner showed me the shortcuts, I googled and found that there is actually a manual page for it -


*What's super cool about Tanner*

He is developing a VR game! The game is set to launch in less than a month in September 2018. Check it out on steam store!

As a VR enthusiast, I asked him what was one thing that he found different in developing VR games than developing pancake (flat-screen) games. 

He said that
 
1. The concept of control is different in VR. Instead of mapping actions to controller buttons, you spend more time to think about what can be done and what feels "natural."

2. There are few visual tricks that won't work in a VR game. An example is that overlaying several flat images to create a nice flame with particle effects. It works very nice in pancake games. In VR (roomscale), however, once you step to the side, the flame looks... flat, and the trick doesn't work. 

He also mentioned that the SteamVR plugin in Unity asset store is a great resource on building your first VR game, as they have coded away a lot of the development hurdles for VR. This is a good time to dive in a try it out!

Thanks a lot Tanner!

Chang Lee

unread,
Aug 23, 2018, 10:29:32 PM8/23/18
to Penny University
Here's the link to the game:


Reply all
Reply to author
Forward
0 new messages