Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

How to click a Object and it appears in 3D

Discussion in 'Scripting' started by coolyer, Aug 31, 2016.

  1. coolyer

    coolyer

    Joined:
    Mar 28, 2015
    Posts:
    4
    im trying to make a Inspectable Object System in unity idk where to start.
    I have tried the bored to bits games and i cant get it to activate the 3d rig
     
    Last edited: Sep 1, 2016
  2. DroidifyDevs

    DroidifyDevs

    Joined:
    Jun 24, 2015
    Posts:
    1,724
    You can use Raycasting to click on an object: http://docs.unity3d.com/ScriptReference/Physics.Raycast.html

    As for rotating an object, you'll have to use something like this:

    Code (CSharp):
    1. transform.Rotate((Input.GetAxis("Mouse X") * RotationSpeed * Time.deltaTime), (Input.GetAxis("Mouse Y") * RotationSpeed * Time.deltaTime), 0, Space.World);
    Also this is a very bad question to post and will result in few answers. Be more descriptive and do your research before posting :)
     
    coolyer likes this.
  3. coolyer

    coolyer

    Joined:
    Mar 28, 2015
    Posts:
    4
    Will do thank you for the help.