Hi, I have an earth globe in a level and I want to detect which continent the player clicks in order to select a map to play on. How can I detect the clicks? Im guessing I can make 2d particles that go onto the continents and detect clicking those, but in that case how can I assign (or even create) those particles to those continents so they get locked onto the earth, because the earth is also spinning? Sorry for the question being complicated, I tried my best.
How did you create the continents?
Just a texture. I can remake it if needed.
If you use a line trace, you get the coordinates returned
If youâre just clicking using the mouse cursor, you can convert that to world coordinates
Once you have a point in the world you can convert it to a point on the globe using a bit of math. You still have to figure out what country that is!
It may or may not be easier to just cover the relevant regions of the globe with collision boxes and then you know where it was clicked. You can parent the boxes to the globe to make sure they move with it.
I think @Everynoneâs answer will be better. You can also find out what part of the texture youâve clicked inâŚ
Can I make the collision boxes continent shaped?
Nope
well im guessing i can model all the continents into seperate objects and trace under mouse cursor by channel > break hit result > hit actor > branch if hit actor has interface âcontinentâ then just detect which continent you clicked
but is it overcomplicated / beginner way?
Here you go ( assuming youâre using the mouse cursor )
Then you can figure out what continent youâve hit from the UV coords
For this to work, you need this project setting
I tried it, but I have no idea what comes after getting the UV⌠Yea, Iâm most certanly a noob in ue5.
So now just figure out which continent is at these coordinates?
It might be the easiest wayâŚ
It depends on a lot, like how finely you want to break things up.
I am trying to get it to detect mouse input but it does not work because UI seems to get input priority. I want the player to be able to interackt with the globe as well as be able to go back using a button on the screen.
Input mode game and UIâŚ
(post deleted by author)
But now the button doesnât work. Input works, but the button is unclickable + every time I click mouse cursor disappears for a split second and appears again
Itâs hard to know exactly what youâre doing, but if youâre switching between the world, it will be a combination of the 3 âset input modeâŚâ nodes.