• Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
  • Help Room /
avatar image
0
Question by dichterDichter · Oct 08, 2015 at 12:12 PM · camerarotationtransformlookat

Creating a Window - Camera movement

Hi,

im trying to use my screen as a "window to another world". I will control this with an eye tracker but the start is difficult somehow, especially because im new to unity but i want to start with a small project.

so, i made a scene with a camera which moves xyz via keyboard tight now (will be an eyetracker later) im trying to get the right fokus of the camera.

i tried transform.LookAt with Vector3, one element as a target but it doesnt work. somehow the camera is moving into the scene. so i thought about calculating the right angle of the camera manually.

is there a small tutorial or example how i could do this step? im hopefully not the first one trying this.

my movement xy with keyboard:

 float xAxisValue = Input.GetAxis("Horizontal");
 float yAxisValue = Input.GetAxis("Vertical");
 var Kamerapos = new Vector3(xAxisValue, yAxisValue, 0.0f);

 if (Camera.current != null)
 {
     Camera.current.transform.Translate(Kamerapos);
 }

Comment
Add comment · Show 2
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image dichterDichter · Oct 08, 2015 at 11:27 AM 0
Share

Projection matrix to get holo effect?

avatar image KwahuNashoba · Oct 12, 2015 at 04:17 PM 0
Share

I'm not sure what you want to acomplish. To rotate camera based on some input or to make camera look towards some object?

0 Replies

· Add your reply
  • Sort: 

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Welcome to Unity Answers

The best place to ask and answer questions about development with Unity.

To help users navigate the site we have posted a site navigation guide.

If you are a new user to Unity Answers, check out our FAQ for more information.

Make sure to check out our Knowledge Base for commonly asked Unity questions.

If you are a moderator, see our Moderator Guidelines page.

We are making improvements to UA, see the list of changes.



Follow this Question

Answers Answers and Comments

38 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

How do I stop the camera from going farther away while I am moving the player and rotating the camera at the same time? 1 Answer

Smooth Look at... 2 Answers

Movement in the direction the user is facing with arrow keys 0 Answers

Record and replay movement 0 Answers

Trouble with Rotations and Transform.LookAt() (I think!) 1 Answer

  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges