I'm trying to set up a spell system similar to the quest for glory games where you click on any location on the screen and a fireball flies to that point. I don't believe there is currently a way to use the mouse click position for any actions besides walking, and while it can probably be scripted easily, it would be nice to have a feature which allows an action to reference the mouse click position. Just an idea! Thanks
Comments
GameObject.FindWithTag (Tags.gameEngine).GetComponent <PlayerInput>().mousePosition
Follow the guide in the manual to learn how to create a custom Action - you can use the ActionTemplate.cs script as a basis.
To run it, you should be able to do it with Menus: create an invisible button that takes up the whole screen, and display it when in "fireball mode". Set the Button's Click Type to Run Menu Action List, and set the Menu ActionList to use your new Action.
You can certainly create a new Icon in the Cursor Manager for your Fireball interaction. If you don't have the Menu on, it'll be detectable - I was under the impression you wanted to use the Menu to toggle on "Fireball mode". Otherwise, yes, you'll probably have to edit the clickmarker script. It's called PlayerInteraction. Check the Update function, which determines which click function to run - in your case, it'll probably be MouseOverHotspots.
Thanks for the help, if I can't figure it out I'm probably just going to run the fireball actions for particular hotspots, which works, but isn't as fun as being able to shoot fireballs at anything in the scene!
Something this specific would likely need custom scripting, but I hope that you can get by without it (or at least something simple enough).
You could also try a bit of a hack whereby you use the position of the Hotspot menu, assuming you've left it's Position Type to OnHotspot. Try this:
Rect menuRect = PlayerMenus.GetMenuWithName ("Hotspot").GetRect ();
Vector2 mousePos = new Vector2 (menuRect.x + (menuRect.width / 2), menuRect.y + (menuRect.height / 2));