I’m having trouble understanding how raycast works, could someone send me an example of a 2D platform where raycast works in these two ways?
1 = Enemy walking from side to side on top of a platform, using raycast to keep from falling off
2 = Enemy follow player if raycast collides with player
Currently in my game I’m using the “distance below”, but when the player is above the enemy, it keeps jumping. I believe that with raycast this can be resolved… But I don’t know how to implement it.
I would be very grateful if you could give me an example like that. Thanks!
I suspect the issue is that you’re firing it at obj_floor. If there’s more than one obj_floor on the scene, it’ll choose [what seems] one at random. Do you need to raycast at obj_floor? Is there any reason why you can’t fire the raycast at a given angle?