- Home /
enabled = false in Start() still receives the LateUpdate() message that one frame.
Basically I have a simple check for isLocalPlayer
in my Start()
message and set enabled = false
based on the result of the check. What happens is my script still receives LateUpdate()
message a single time that one frame. Is there a way to prevent that without writing an if in the LateUpdate()
?
Answer by cubrman · Jul 29, 2016 at 07:00 PM
Ok I was able to side-step the problem:
I set
enabled = false
in theAwake()
method of my MonoBehaviour component.I overrided
OnStartLocalPlayer()
in my NetworkBehaviour component and inside that metod I called a publicInitialize()
method from my MonoBehaviour component.In the
Initialize()
I setenabled = true
and everything works without errors.
Your answer
Follow this Question
Related Questions
Disable Object Leave Script Running 1 Answer
gameObject.enabled is not working 1 Answer
Script keeps functioning when disabled 1 Answer
this == null 1 Answer
Using a String in an Enable statement 2 Answers