Search Unity

Getting 3D object position in System.Drawing.Point

Discussion in 'Scripting' started by MsCaligari, Mar 31, 2015.

  1. MsCaligari

    MsCaligari

    Joined:
    Feb 5, 2013
    Posts:
    1
    Hello,

    I've made a game where the mouse position is very important for game-play. My problem is : if I let the cursor where the player let it on last level, it will activate objects that I don't want (activation is set by the distance between cursor position and player). In one particularr level, if the objects near the player are activated, he will die. The player needs to be very careful of not activating them in this part.

    That's why I need to set the mouse position in Awake to the player's position.

    I looked around and found how to get the mouse position (adding the needed dll to plugins) and how to modify it. Here is what I have :

    Code (CSharp):
    1. System.Windows.Forms.Cursor.Position = new System.Drawing.Point(myPlayerPosition));

    This would work but I can't figure out how to get the system position of my 3d object. I know it is possible...
     
    Last edited: Mar 31, 2015