How to spawn objects in a specific range of random location

I have a tile based game. Each tile’s position is a multiple of 1.25, (For Example: 7.5, 3.75) and I want to spawn walls at a random location but at a specific range. I tried Random.Range(7.5,6.25) but that spawns anywhere BETWEEN the 2 numbers instead of spawn in either of those 2 locations. Is there a way of spawning objects like that? Thanks! (Btw I would really appreciate it if you answer in javascript because I don’t really know much about c#)

If you want a random value between just two numbers then you can use

Random.Range(0,2);

This will give you result as either zero or one then you can have a value pre-defined for 0 i.e. 7.5 and for 1 it will be 6.25.

Or if you just want to generate a random number between all whole range of tiles you can use something like:

1.25 * Random.Range(0,N);

where N can be any integer based on the number of tiles.

So if the random generated number is 2 then you will get the position to place is as 2.5 since it is your second tile.