1

enter image description here

Making an area to randomly instantiate objects by coordinates in is easy but for my project I need to randomly instantiate objects in the spawn area while still avoiding to accidentally spawn objects in the red area{blocked area}.

This is not a question regarding numbers it is more regarding coordinates, I seek for objects to instantiate around the point therefore having example: 2, 12 or -3, -10 as spawning points and not just be ignored since it has the blocked area values.

Heres a picture for explanation. The black area marked as Spawn area is the area I wish to have the objects be instantiated in randomly

The red area marked as Blocked Area is the area I wish my instantiation avoids when getting instantiated.

This is a 3D project but it does not really matter if you make it Vector3 or Vector2 since the Y axis doesnt matter in my project.

Hymandois
  • 21
  • 6
  • The linked question is nothing near my question. I simply asked for coordinate-help and you link this to a question about random numbers excluding certain range of numbers. The linked question is also about something I specifically said NOT to do which makes me think this is literal moderation abuse to just ignore a question when Ive been desperatly trying to work this problem off – Hymandois Jun 09 '22 at 20:19
  • Coordinates are just numbers. The linked solution should work for you. Try generating each coordinate component separately, then check that the coord does not fall in the "blocked" range. If you are looking for a math heavy approach, you might try asking on a math forum. – hijinxbassist Jun 09 '22 at 22:29

0 Answers0