|
I'm a noob at scripting and haven't seen what I would like to be able to do. Or maybe I have and it hasn't dawned on me.... The idea is to use a script applied to many different cubes that allows a cube to be clicked. When clicked the camera should snap to a location directly in front of that cube. When clicked again, the camera should snap back to its initial location. I've figured out how how to get a screen cross fade to work between 2 cameras; however, I need to be able to use just the main camera. Any help would be greatly appreciated. Thanks.
(comments are locked)
|
|
This is the bit of code I think you want: EDIT: Hacked to solve your comment.
From RaycastHit, you can detect which object you have hit, and also get the point of the hit, allowing you to move the camera. I thought that might work; however, it's not quite right. I've got the project designed layed out kinda like the periodic table, so I'm trying to make it more of a learning activity program more than a gaming. The user should be allowed to click on an object and the camera move in to see certain information then be allowed to click on it again to see a full view of the layout. Since there's more than one box of information, I remember seeing something about interpolation for the position and direction of the movement. Maybe something along there would be the best approach?
Jan 26 '10 at 05:43 PM
Kitty
This just gets you the correct position or object that the user clicked on - interpolation would be different, ill post a quick sample
Jan 26 '10 at 06:09 PM
Brian Kehrer
Be awesome if you could do so.
Jan 27 '10 at 03:31 PM
Kitty
I am also trying to do something similar, but I'm having difficulty precisely controlling the camera movement. It's shaky in parts. I want the user to click on certain objects in 3D space and be "zip lined" to that location. It would be AMAZING if you could post a sample. Thanks!
Feb 07 '10 at 04:18 PM
Melissa
I'm like Melissa. I like how it goes to where you click; however, I'm looking for something that'll make it go to the center of that object despite where the user clicks. I've put this project aside to work on other things, so I haven't had time to figure it out. Hopefully I'll pick back up on it later this week.
Feb 22 '10 at 04:33 PM
Kitty
(comments are locked)
|
|
I had help in another one of my questions, but here's the code that I'm working with applied to the camera that will offset from the object clicked.
(comments are locked)
|
