I’m trying to move a object to the mouse position. But it’s giving me large x value like 300 but at that place the pre placed object’s x position is -4.
rigidBody.velocity = new Vector3(Input.mousePosition.x, EndPointY, 0)*4;
So how can I get the current mouse position?
Thank you..
Related Posts:
- How to find child of a GameObject or the script attached to child GameObject via script
- How to make the script wait/sleep in a simple way in unity
- Unity OnTriggerEnter2D not registering
- OnCollisionEnter() not working in Unity3D
- Unity cannot convert from ‘string’ to ‘int’
- Can’t add script component because the script class cannot be found?
- Why should I use SerializeField?
- OnTriggerEnter not working at Unity3D
- How to jump in Unity 3d?
- Unity3d no Monobehaviour scripts in the file, or their names don’t match the file name
- Unity3d restart current scene
- How to move 2D Object with WASD in Unity
- The Object you want to instantiate is null. Unity 3D
- Unity 2d jumping script
- OnCollisionEnter2D not being executed?
- Unity “The associated script can not be loaded” and “Win32Exception: The system cannot find the file specified”
- Unity – Gameobject look at mouse
- Error when Building Project: Error building Player because scripts have compile errors in the editor
- Unity3D. Trying to send command for object without authority
- Expression denotes a `type’, where a `variable’, `value’ or `method group’ was expected UNITY3D
- How to pass data (and references) between scenes in Unity
- Rotate object in Unity 3D
- OnCollisionEnter is not called in unity
- Unity 5.2.2 changing Visual Studio back to MonoDevelop
- “A namespace cannot directly contain members such as fields or methods”
- Unity – How to stop Play Mode in case of infinite loop?
- Unity Scripts edited in Visual studio don’t provide autocomplete
- Is there a keyboard shortcut to maximize the Game window in Unity in Play Mode?
- How to connect to database from Unity
- What is IP address ‘::1’?
- How to fix No connection could be made because the target machine actively refused it 127.0.0.1:64527
- Converting string to byte array in C#
- How to use SQLite in Visual Studio 2017?
- How to convert byte array to string [duplicate]
- C# Java HashMap equivalent
- Configuration System Failed to Initialize
- The request was aborted: Could not create SSL/TLS secure channel
- The located assembly’s manifest definition does not match the assembly reference
- Get current folder path
- foreach vs someList.ForEach(){}
- LEFT OUTER JOIN in LINQ
- How can I find a specific element in a List
? - XAML Binding Groups
- Does not contain a static ‘main’ method suitable for an entry point
- Checking if an object is null in C#
- How to use Global Variables in C#?
- Add new item in existing array in c#.net
- How to fix file format and extension don’t match?
- Invalid length for a Base-64 char array
- The HTTP request was forbidden with client authentication scheme ‘Anonymous’. The remote server returned an error: (403) Forbidden
- Why am I getting a “Could not find a part of the path” exception?
- Convert date yyyyMMdd to system.datetime format
- How to bind a model to a kendo Combobox in order to use the models validatation?
- HttpWebRequest-The remote server returned an error: (400) Bad Request
- MSHTML DLL on Windows 10
- Adding values to a C# array
- C#: how to get first char of a string?
- how to convert C# to C++
- Reading settings from app.config or web.config in .NET
- How to initialize a list of strings (List
) with many string values - Collection was modified; enumeration operation may not execute
- Cross-thread operation not valid: Control accessed from a thread other than the thread it was created on
- What does the @ symbol before a variable name mean in C#?
- What is the C# version of VB.net’s InputDialog?
- How to add comments into a Xaml file in WPF?
- How to easily initialize a list of Tuples?
- How do I target @Model within a src of an image tag?
- How to round up in c#
- Converting from IEnumerable to List
- Escape double quotes in a string
- How to do constructor chaining in C#
- What represents a double in sql server?
- How do you get the index of the current iteration of a foreach loop?
- How do I restart my C# WinForm Application?
- WSACancelBlockingCall exception
- Padding is invalid and cannot be removed?
- Why is it that “No HTTP resource was found that matches the request URI” here?
- Best way to reverse a string
- C# Foreach statement does not contain public definition for GetEnumerator
- How do I exit a foreach loop in C#?
- Fastest way to remove first char in a String
- How to convert datetime format to date format in crystal report using C#?
- Most efficient way to remove special characters from string
- When do we use ANTLR
- How would you count occurrences of a string (actually a char) within a string?
- C# equivalent to Java’s charAt()?
- How to play a sound in C#, .NET
- Convert SQL to LINQ Query
- How to resolve file being used by another process?
- How to crop an image using C#?
- How do you wait for input on the same Console.WriteLine() line?
- Why doesn’t C# have header files? Will the namespace take care of everything?
- How to avoid a System.Runtime.InteropServices.COMException?
- Define: What is a HashSet?
- Convert string to decimal, keeping fractions
- Format of the initialization string does not conform to specification starting at index 0
- How can I generate random alphanumeric strings?
- How do you do a deep copy of an object in .NET?
- Cannot declare instance members in a static class in C#
- How to convert HTML to PDF using iTextSharp