The question is answered, right answer was accepted
Unity freezing when OnPointerEnter event,Unity freezing when OnPointerEnter happens,Unity freezing when OnPointerEnter occurs
I'm working on a project for Cardboard that will allow the user to move by looking at the ground. I have a "Walk" script attached to the Player:
and a "Ground" script attached to a Plane that I'm using as the ground:
For some reason, when I test the scene, Unity freezes when the pointer enters the ground. I'm new to this and have no idea why this is happening. Any help would be appreciated.
Answer by Prastiwar · Feb 10, 2018 at 10:26 AM
Your problem is while loop in FixedUpdate, you call walk() tons of time per frame, that's why unity freezes. Just replace "while" with "if " and it'll be good.
Follow this Question
Related Questions
Error!!! NullReferenceException: Object reference not set to an instance of an object 2 Answers
I'm adapting the portals from Brackeys to VR, how to stop Z axis from rotating in render texture? 0 Answers
GoogleVR / C# - How to, with the "pointer click": click 1 move a cube and click 2 move back the cube 0 Answers
VR SSO Login using OIDC Codeflow 1 Answer