• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.
  • The Hive's 22nd Icon Contest: Creep Abilities is now concluded, time to vote for your favourite set of icons! Click here to vote!
  • ✅ The POLL for Hive's Texturing Contest #34 is OPEN! Vote for the TOP 3 SKINS! 🔗Click here to cast your vote!
  • ✅ The POLL for Hive's Techtree Contest #20 is OPEN! Vote for the TOP 3 FACTIONS! 🔗Click here to cast your vote!

Getting mouse position

Status
Not open for further replies.

CannonFodder100

C

CannonFodder100

How might one go about acquiring the current position of the mouse in a trigger? For example, upon hitting Numpad 1, it grabs the mouse's position and either moves a point to it if necessary or simply plugs the value into another action which would create a unit at point.

Thanks, and let me know if I need to clarify.
 
  • Clickie Clickie
    • Events
      • UI - Player 1 clicks Left mouse button Down.
    • Local Variables
      • Mouse X = 0.0 <Real>
      • Mouse Y = 0.0 <Real>
      • Mouse Z = 0.0 <Real>
      • Mouse Clicked Position = No Point <Point>
    • Conditions
    • Actions
      • Variable - Set Mouse X = (Mouse X position clicked in the world)
      • Variable - Set Mouse Y = (Mouse Y position clicked in the world)
      • Variable - Set Mouse Z = (Mouse Z position clicked in the world)
      • Variable - Set Mouse Clicked Position = (Point(Mouse X, Mouse Y, Mouse Z))
 
Thanks, Splashy, that's exactly what I needed to know. Using that, I can set those variables and move a point or maybe actually just plug that straight into a Create Unit or whatever trigger. Perfect solution, and exactly what I needed to know.
 
Status
Not open for further replies.
Back
Top