Adding some offset value for RayCast 2D but what is the distance unit?
I tried to put as much information in title as possible.
As far as I understand RayCast2D begins from the center point of the game object it originates from. If I am to check if it collides with an object having a box collider, then I need to make sure it doesn't collide with the object it is originating from, correct?
To do that, I added some offset float value by trial and error that would put the Ray origin point outside the game object's box collider, however I had to do this by trial and error. I ended up with some value that works for me, but I don't know what unit that value is.
Can someone explain to me please how much say 1.0 float offset would mean in the game? How does that unit relate to the sprite/pixel character of mine?
I just want to make sure the next time I'm doing a RayCast or anything where I need to put some distance value, I understand what it correlates to and if I can put values WITHOUT TRIAL AND ERROR.
I hope I was able to explain my doubt. Thanks in advance for any help!
In the editor there should be a grid you can see, those grids are often the unit grid. If you need a clear visualization of how much that unit is, select an object, and add 1 to it's x or y location in the inspector and look at how far it moves, that's 1.0 units.