Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System.Collections;
- using System.Collections.Generic;
- using UnityEngine;
- public class PlaceCube : MonoBehaviour
- {
- // Update is called once per frame
- void Update()
- {
- if (Input.GetMouseButtonDown(0))
- {
- Vector2 screenpos = new Vector2(Input.mousePosition.x, Input.mousePosition.y);
- Vector3 worldpos;
- if (ZEDSupportFunctions.GetWorldPositionAtPixel(ZEDManager.GetInstance(sl.ZED_CAMERA_ID.CAMERA_ID_01).zedCamera, screenpos, ZEDManager.GetInstance(sl.ZED_CAMERA_ID.CAMERA_ID_01).GetLeftCameraTransform().GetComponent<Camera>(), out worldpos))
- {
- GetComponent<Rigidbody>().velocity = Vector3.zero;
- transform.position = worldpos + Vector3.up;
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement