I want to spawn things in the place I'm clicking, can I get mouse coordinates relative to the map?
Comments
gyroscopeI am here.Member, Sous Chef, PROPosts: 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.
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.
tenrdrmerMember, Sous Chef, Senior Sous-ChefPosts: 9,934
Comments
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.
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.