roaddog Posted May 17, 2016 Share Posted May 17, 2016 Hi, So how could it be possible to get random coords inside radararea? Link to comment
Mr_Moose Posted May 18, 2016 Share Posted May 18, 2016 (edited) When you create it you could save it's coordinates and size as element data for easy access and then use: local x = math.random(x_pos, x_pos+x_size) local y = math.random(y_pos, y_pos+y_size) To get some random coordinates within. Edited May 18, 2016 by Guest Link to comment
roaddog Posted May 18, 2016 Author Share Posted May 18, 2016 Aint it has to be like x_pos + x_size on second arg of math.random to get the max x pos? cuz its the size not the pos... Thank you for the help. Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now