- Home /
how to make a pick up selection UI in game like free fire?
I'm trying to make a shooter game, by using Physics.OverlapCapsule()
I find all pick up objects around the player. but I dont know how to make an UI selection box to click on every item to pick it up. because I'm using Physics.OverlapCapsule()
in Update function if I active UI elements in this function it make many UI objects and if destroy UI elements in start every frame I cant use click event. appreciate that to help me if there is any way to solve this problem.
I solve this by some if statements in update function, but glad if there is a better way.
Answer by VoidPhoenix96 · Aug 14, 2021 at 04:51 PM
Are you storing all the pick up objects in an array? That way you could add a World Space UI icon to all of the pick up objects that isn't enabled by default, and when you're in range, you could enable it.
yes, all the pick up objects are in an array by Physics.OverlapCapsule()
. but because it's a mobile game I dont want to use word space UI icon for all of them to make gamer confuse. I'm asking a way to show pick up elements in slider inside main canvas.
Your answer
Follow this Question
Related Questions
UI Slider looses control in Update function 1 Answer
How can an UI Element know on which 3D Object it is pointing? 1 Answer
Weapon pick up 3 Answers
Show panel when collide on prefabs 0 Answers
Adding commands from Update function to a UI button. 1 Answer