#What am I doing wrong?
15 messages · Page 1 of 1 (latest)
The raycast mask is set to 2, while the enemy is on 3. More, the raycast is not even touching the enemy.
Shot in the dark, but maybe your scale.x = 1 and scale.x = -1 might cause an issue?
From the docs:
How do I flip it then?
I thought that's how you're supposed to do it?
I don't know if that counts for Raycast2D to be honest..
You could flip only the sprite using sprite.flip_h
and then you'd have to reposition the raycast so it's on the other side
I know about that, but will I have to make two raycasts then?
Or that
I'll try that then
Oh so actually I just used two raycasts just so I can tell which side a hole may be on. I tweaked the code and it works now, I guess