Make sure it's on the floor, what goes through the floor when you tap a little bit. Now, I've got the pivot of the scene in the wrong place. Actually, I spent a lot of time getting the ping pong table set up. Let's go to ping pong table, one which I created earlier. Import that, and we have our ping pong prefab. And we've got this ping pong Unity package. So we've now got a properly empty scene, and we're going to now import the package that we created in our other projects. But I'm then going to just delete everything else. I'm going to keep the directional light and the floor because I don't want it to fall to the floor. But I'm going to get rid of the apple tree, the flower gun. It makes a noise whenever something falls on the ground. I'm going to create collision sound controller. And I'm going to get rid of all the stuff that isn't all of the objects. What I'm going to do is actually make use of this example scene but to save as and call it MyPingPong. But I won't to give you a full demo of it today. I think that's really exciting I have really. And I can grab something and I can throw it and it falls on the floor. As I move around, I've got a controller here which you can see. I'll put some notes about that in the readings after this video. And if you don't have it installed, it'll say install and take you to the install page with instructions on how to create the Oculus SDK. Before I do anything, I need to select this thing at the top called NVR player. And what I'm going to do is now open the NewtonVR example scene. So I'll give some links to instructions on how to do that. While doing that, I've imported the Oculus OVR SDK. So I've imported it from the asset store. And currently, there's no scene here but I've already imported NewtonVR. Okay, so now this is a file called the Unity package that we can then important into a new project. I've actually done this before so it already exists there. So I'm going to right click on ping pong table and then do export package, and I'm going to export it into this file, NewtonVR test and I'm going to call it PingPong. I'm going to use this to save everything, to export it. Isn't that cool? I don't want two ping pong tables, but I'm going to do something more important than that. It's an asset that I could drag it in if I wanted yet another ping pong table. And if we do that, it actually creates what we call a prefab, which is a preexisting thing. Once we've got everything inside the same object, we can drag it from the hierarchy which are the things that are currently in this particular scene into the project, which has all the assets, the saved files that we've got. Why have I done that? Well, because I'm going to show you a trick. Okay, so that's all set up quite nicely, and we've got everything inside this object ping pong table. I can just sort of move it that way I want it. The Y is fine so they should be at a move. So I'm going to set the other bits of the ping pong table to the base and the top to be at X and Z zero. I was not very careful when I created it. So here we are.I'm going to also tidy up a few things about this, okay? If you look at the ping pong table, the center of the ping pong table is actually in a slightly weird place for this ping pong table. So they're all inside the main ping pong game object which isn't have not been called Ping Pong. I want the ball, the bat and the ping pong table. And I'm going to add all of the bits to do with ping pong to it. So I'm going to move all these down to the bottom, and I'm going to create a new game object, an empty one called PingPong, which I'll create in one place, there. And I'm going to show you a way of doing that. So what I'm going to do is I want this ping pong table, the ping pong ball and the bat to import into a new project. So I think, I find it's best if you're using NewtonVR to start with a blank NewtonVR project and then import your other assets. Now, it's really good but one of the downsides, it can be a little tricky to set up in your own project, and I had trouble with that. And it's free, and it's a great starting point. So we're going to use a plugin called NewtonVR, which makes it very easy to create sort of interactive behavior with physics objects. So we're not going to work with the built-in thing. Now, in this video, we're going to look at that, but we're going to use a plugin that makes it easy to do that. We actually want to pick up our ping pong ball and play ping pong. We now know how to create physics objects that allow us to do the dynamic movements and interesting interactions, but we haven't been able to interact with them yet.
0 Comments
Leave a Reply. |