Blutility - Construction script and mouse input
I'm gonna try make this short, I'm currently making a grid based strategy game using 4.17.2. The grid consists of one actor that spawns every tiles in its construction script. In addition to that every tile can be modified via several arrays (i can delete, rise, lower, add resources and building on any specific tile). I was looking at ways to easily select individual tiles (which are the actor's components) in editor.
So I managed to make a blutility blueprint that lets me customise the grid. I have a range of "Call in editor" functions that get the position of the camera and line traces down to the grid to select individual tiles (by casting to the grid I can get the hit components) and edit corresponding arrays. However, sometimes when I edit the grid, it won't re run its construction script until I manually open its blueprint and compile it.
Do you know if there is any way to run or refresh a construction script through blueprints?
I was also wondering if there was any ways to get mouse input (buttons would be awesome but simple conversion from screen to world of the coordinates is enough) within a blutility blueprint?
I know I can get the mouse's position on viewport but I can't convert it to world space without a player controller. I tried looking at ways to calculate it manually but from what I understood I need the camera's matrix which I don't know how to get in blueprints.
The pictures simply shows the blutility functions, the linetrace down and some of the tile customisation. I know blutilities are still experimental but I'm really curious of its capabilities. Sorry if this was too long to read, I couldn't think of otherways to explain myself ...
Follow this question
Once you sign in you will be able to subscribe for any updates here