• Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by Shkarface-Noori · Sep 20, 2013 at 09:45 PM · eventufps

'EventType' does not contain definition for "MouseUp"

i just installed the UFPS AI Addon and i have this error:

CS0117: 'EventType'does not contain definition for "MouseUp" and it happens in a script called TargetMover.cs at line 23 as this is the code: using UnityEngine; using System.Collections;

 public class TargetMover : MonoBehaviour {
     
     /** Mask for the raycast placement */
     public LayerMask mask;
     
     public Transform target;
     
     /** Determines if the target position should be updated every frame or only on double-click */
     public bool onlyOnDoubleClick;
     
     Camera cam;
     
     public void Start () {
         //Cache the Main Camera
         cam = Camera.main;
     }
     
     public void OnGUI () {
         
         if (onlyOnDoubleClick && cam != null && Event.current.type == EventType.MouseUp && Event.current.clickCount == 2) {
             UpdateTargetPosition ();
         }
     }
     
     // Update is called once per frame
     void Update () {
         
         if (!onlyOnDoubleClick && cam != null) {
             UpdateTargetPosition ();
         }
         
     }
     
     public void UpdateTargetPosition () {
         //Fire a ray through the scene at the mouse position and place the target where it hits
         RaycastHit hit;
         if (Physics.Raycast    (cam.ScreenPointToRay (Input.mousePosition), out hit, Mathf.Infinity, mask)) {
             target.position = hit.point;
         }
     }
     
 }
 
Comment
Add comment · Show 1
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image michael_house · Mar 09, 2014 at 03:11 AM 0
Share

Was the supplied answer not useful to you? It it was please accept it, otherwise add your own answer on how you fixed this.

1 Reply

· Add your reply
  • Sort: 
avatar image
2
Best Answer

Answer by michael_house · Sep 20, 2013 at 11:05 PM

Since you've just installed another add-on this gives you a clue as to what might be happening. Ensure that the new add-on you installed does not also have an enum type EventType.

You can fully qualify the EventType you're trying to use with UnityEngine.EventType.MouseUp so the compiler knows which one to use.

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Welcome to Unity Answers

If you’re new to Unity Answers, please check our User Guide to help you navigate through our website and refer to our FAQ for more information.

Before posting, make sure to check out our Knowledge Base for commonly asked Unity questions.

Check our Moderator Guidelines if you’re a new moderator and want to work together in an effort to improve Unity Answers and support our users.

Follow this Question

Answers Answers and Comments

16 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

EventType.MouseUp seems to dislike buttons 1 Answer

Preventing editor deselect on MacOS 1 Answer

Gui.modalWindow catch mouseUp event outside of the window 0 Answers

Add event listener to referenced prefab Child 1 Answer

Is it wise to add scripts to Unity's Event System? 0 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges