| 01-27-2007, 09:15 AM | #1 |
I wonder if it's possible to get camera target coordinates for certain player in multiplayer game. Then I'd like to move a unit owned by player to these coodrinates. The following code doesn't work: JASS:function MoveUnitToCameraTarget takes unit u, player p returns nothing local real x local real y if(GetLocalPlayer()==p)then set x=GetCameraTargetPositionX() set y=GetCameraTargetPositionY() endif call SetUnitX(u, x) call SetUnitY(u, y) endfunction I'm not sure if I do it correctly, so I ask for help. |
| 01-27-2007, 10:08 AM | #2 |
| 01-27-2007, 11:00 PM | #3 |
Guest | JASS:function MoveUnitToCameraTarget takes unit u, player p returns nothing local location l if(GetLocalPlayer()==p)then set l=GetCameraTargetPositionLoc() call SetUnitPositionLoc( u, l ) call RemoveLocation(l) endif endfunction Try this? |
