Closed PembleC closed 4 years ago
void Update () { if(Input.GetMouseButtonDown(0)) { Vector2 screenpos = new Vector2(Input.mousePosition.x, Input.mousePosition.y); Vector3 worldpos; if(ZEDSupportFunctions.GetWorldPositionAtPixel(screenpos, ZEDManager.Instance.GetLeftCameraTransform().GetComponent<Camera>(), out worldpos)) { GetComponent<Rigidbody>().velocity = Vector3.zero; transform.position = worldpos + Vector3.up; } } }
You're talking about this code, right?
Finished a while ago with the new Input2.0 Scene. Look at MyActionScript for a sample of how to create game objects based off of user controller input.
In the Main assets folder is a C# script that doesn't work. The idea is from the stereo labs page "https://www.stereolabs.com/docs/unity/object-placement/" but their code is outdated. Need to find a new way to place objects on command and the location of the mouse position.