Question by
Mschri · Jul 31, 2016 at 02:17 PM ·
scripting problemscript errorcompilercompiler errorscriptingproblem
Unity 5 checking if player isGrounded
Hello, I having trouble trying to figure out how to check the player object isGrounded. I was following a tutorial on Youtube and I recieve a error message saying that the code I used is obsolete. I have tried to look for a solution for it on the Unity community but only found out of date forum pages or irrelevant answers to my question. Thank you!
check-player-isgorunded.jpg
(72.8 kB)
Comment
Best Answer
Answer by Mschri · Jul 31, 2016 at 05:41 PM
I figured out the issue.
Fixed: disToGround = GetComponent.().bounds.extents.y;
return Physics.Raycast(transform.position, -Vector3.up, disToGround + 0.1);