Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 Jun 22
sparklines
Close Help
  • 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 /
  • Help Room /
This question was closed Dec 08, 2015 at 10:37 PM by Bunny83 for the following reason:

Question is off-topic or not relevant

avatar image
-2
Question by Tritofic · Dec 08, 2015 at 11:53 AM · movedlletc

Can I make my cursor move using Unity in Source games?

I play a game called CS:GO and I was wondering if it was possible to move my cursor within the game. CS:GO is made by valve and runs on the Source engine. At the minute, I am able to move my cursor through code while window focus is on Unity or Google Chrome. I do have "Run In Background" checked.

Here is my current code:

 using UnityEngine;
 using System.Collections;
 using System.Drawing;
 using System.Runtime.InteropServices;
 
 public class MouseControl : MonoBehaviour {
 
     [DllImport("user32.dll")]
     public static extern bool SetCursorPos(int X, int Y);
     [DllImport("user32.dll")]
     public static extern bool GetCursorPos(out Point pos);
 
     Point cursorPos;
 
     // Use this for initialization
     void Start () {
         cursorPos = new Point();
         GetCursorPos(out cursorPos);
         Invoke("moveMouse", 3);
     }
 
     void moveMouse() {
         SetCursorPos(cursorPos.X, cursorPos.Y + 150);
     }
 }
 



I have not yet compiled this, but I don't think that is the problem.

Thanks in advance, and I am really sorry if this is just a noob question.

Comment
Add comment · Show 2
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 Tritofic · Dec 08, 2015 at 10:06 PM 0
Share

Has anyone found anything about this? I would really like to know.

avatar image Bunny83 · Dec 08, 2015 at 10:41 PM 0
Share

This question has nothing to do with Unity. You're using a windows API function which has no relation to game development with Unity. It also seems you try to manipulate other game applications in order to automate something or to cheat in that game. If that's the intention you're completely wrong here.

  • Closed.

0 Replies

  • Sort: 

Follow this Question

Answers Answers and Comments

4 People are following this question.

avatar image avatar image avatar image avatar image

Related Questions

About generated dlls and Unity 1 Answer

Adding Packages from Nuget - Some get removed while others don't? 0 Answers

System.Threading.Tasks.Extensions.dll is not allowed to be included or could not be found 1 Answer

Unity mobile game build working from personal license but giving compile error with pro license 0 Answers

Move the character automaticly with the road 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