Hello,
ok, acutally i have a few more questions, but let’s start with the mouse cursor.
What i’m trying to do is, to tell my mouse which gun should be fired by clicking the LMB, depending on the cursor position.
For example:
I have 3 guns placed in a row at the bottom of my screen:
One on the left, in the middle and one on the right.
When the cursor is more on the left side of the screen, the gun on the left should be fired, if its more in the middle, the gun in the middle should be fired and so on.
I know there is a node “getViewportSize” and “getMousePosition”.
But i’m not really sure, how to start…
Let’s say ViewportSize is X 1920 and Y 1080.
I have to divide X with 3 and compare it.
If it’s < than 640, fire “gun left”, if it’s > than 640 but < than 1280 fire “gun middle” and if it’s > 1280 fire “gun right”.
But the problems with these numbers are, what if the screen size changes, depending on the the players screen resolution or mobile he is using.
- How can i tell my blueprint to react, when my mouse is in a specific part of my screen?
- And is this something i should do in the level blueprint or in my Gun-Blueprint?
- Do i need three different Blueprints for each gun or can i do this with one gun-blueprint?
I know it’s a lot and very complicated, but i hope someone can help me with it.
Thanks in advance!
Greetings
Ace