Quantcast
Channel: Questions in topic: "error message"
Viewing all articles
Browse latest Browse all 2891

Help im getting the following error: error CS0121. The rest of it is in the description

$
0
0
Assets/Drag.cs(12,66): error CS0121: The call is ambiguous between the following methods or properties: `UnityEngine.Vector3.operator -(UnityEngine.Vector3, UnityEngine.Vector3)' and `UnityEngine.Vector2.operator -(UnityEngine.Vector2, UnityEngine.Vector2)' using UnityEngine; using System.Collections; [RequireComponent(typeof(BoxCollider2D))] public class Drag : MonoBehaviour { private Vector3 screenPoint; private Vector3 offset; void OnMouseDown() { offset = gameObject.GetComponent ().velocity - Camera.main.ScreenToWorldPoint(new Vector3(Input.mousePosition.x, Input.mousePosition.y, screenPoint.z)); } void OnMouseDrag() { Vector3 curScreenPoint = new Vector3(Input.mousePosition.x, Input.mousePosition.y, screenPoint.z); Vector3 curPosition = Camera.main.ScreenToWorldPoint(curScreenPoint) + offset; GetComponent ().velocity = curPosition; } }

Viewing all articles
Browse latest Browse all 2891

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>