I know the last post was a relatively long time ago, so I hope this isn’t too late!
I’m trying to use some of your code in my 2d bomberman clone, and I’m having all sorts of problems with the raycasting bit
Here is my code, and, before anyone jumps on me: yes, I did convert from physics/raycast to physics2d/raycast2d
The error I’m getting is in the line: Physics2D.Raycast (transform.position + new Vector3 (0.0f, 0.5f, 0.0f), direction, out hit, i);
I keep getting an error that says: cannot convert ‘out UnityEngine.RaycastHit2D’ to ‘float’
I think it’s telling me that it can’t convert the Raycast2DHit hit to a float, which makes sense, but when I try to rearrange that line, I get an error that says Use of unassigned local variable ‘hit’.
So, it seems like I’m getting yelled at for trying to retrieve the info about whether or not my ray hit something, but then getting yelled at again if I don’t look for that info.