Hello everybody!
I’m have been working with Unity for the past few months but, I can’t seem to hammer this issue out.
I find myself with a bit of a bizarre issue. I’m currently working on a "2.5"d platformer game and using the Physics engine with Unity for all my movements. I’m having issues checking whether if my player is on the ground on not. I have tried using (and combinations of) Physics.Raycasts and some other tricks and checking normals (i.e. on a collision checking if all the normals are pointing directly vertical). My issue comes especially when I have my player sitting directly beside a wall jumping where for some reason the logic follows thinking I am still on the ground when I jump midair and then go near a wall (yet my raycast doesn’t extend that far on the left and right regions of the bounding box). I have zeroed out the possibility of it being one vector cancelling out and extending the vertical velocity.
Can anybody point me to a good tutorial or code on checking if the player is on the ground? Or any tips in regard to this? I will note once again I am using the Unity Physics engine.
Thank you very much!
Have a beautiful day!
Dan