Clicking coordinates are relative to screen, not map.

I want to spawn things in the place I'm clicking, can I get mouse coordinates relative to the map?

Comments

  • gyroscopegyroscope I am here.Member, Sous Chef, PRO Posts: 6,598

    Hi @ProjectorX, you can select Position in the Spawn behaviour as either Relative to actor or scene.

    But anyway, if your map doesn't move, it wouldn't matter, surely that your mouse/touch coordinates are relative to the scene anyhow, they'll still be relative to to the map, if you use that for your When Touch is pressed/mouse is down Rule.

    ""You are in a maze of twisty passages, all alike." - Zork        temp domain http://spidergriffin.wix.com/alphaghostapps

  • ProjectorXProjectorX Member Posts: 45
    Yes the map is a different size than the screen. I'm using a "Move to" behavior too.

    Basically, you click, it sets game.shootX and game.shootY to the mouse coords, spawns a dynamite actor, which is supposed to move to those game attributes.

    But I can't even get it to directly spawn on the coordinates where I clicked relative to the map.
  • tenrdrmertenrdrmer Member, Sous Chef, Senior Sous-Chef Posts: 9,934
    You have to put in an offset for you mouse click.

  • ProjectorXProjectorX Member Posts: 45
    Thanks. This works.
Sign In or Register to comment.