- Home /
Move Objects which are far away.
Hey,
I need your help. I have 3 different objects (o1,o2 and o3). Now I would like to move (with keys "q" and "e" on z-Axis) the object which my camera is focused on. You know what I mean? I focus object a and while push the key "e" the "object a" moves to the right... and so on ...
It would be very nice if you can help me. I couldnt find a good tutorial via google.
cheerio tobias
I've found a nice way to sect an object,... but it will not work for me (no idea why!)
hier it is...
function Update () { if ( Input.Get$$anonymous$$ouseButtonDown(0) )
{ var hit : RaycastHit; var ray : Ray = Camera.main.ScreenPointToRay (Input.mousePosition); if (Physics.Raycast (ray, hit, 100.0)) { Debug.Log(hit.collider.gameObject.name);
}
} }
I thouth, i could focus an object... and when i press "q" or "e" it will be moved... in the script I shown here, i should get a "log"-entry after clicking the left mouse key... but its not working... any Idea why??
Your answer
Follow this Question
Related Questions
Use OnTriggerEnter during a transform ! 0 Answers
Raycast when swipe or touchphase move 0 Answers
How to get a ai to drive to a raycast 0 Answers
Why is this Raycast not working ? 3 Answers
Following Terrain Height? 2 Answers