[Unity-6] Sometimes GameObject cannot be rendered, unity-6gameobject

Source: Internet
Author: User

[Unity-6] Sometimes GameObject cannot be rendered, unity-6gameobject

Problem description:A monster encountered such a problem during the game. It would be okay if he was shown in the center of the screen, but let him appear at the edge of the screen to find that he did not appear.


Cause:After checking, I found that I added an Animator control to this GameObject, and set the Animation Mode to Based on renderers. changing it to Always Animate can solve the above problem.



PS:It is difficult to find this error because of lack of a comprehensive understanding of Unity. Therefore, you should first repeat the basics.


How does Unity3d adjust the visibility of GameObject? Is there any function?

Remove the small check mark of the name in the Inspector panel to make the object invisible.
For code, you can use the GameObject. active attribute to set false to invisible.
For component objects, you can use. enable = false to make the component unavailable.

Unity C # How does one public gameobject reference this gameobject in another script in the same scenario to obtain attributes?

A direct GameObject. Find (name) is not recommended.
2. Add tags to the gameobject to be obtained. In the script, GameObject. FindGameObjectWithTag (TAG) or GameObject. FindWithTag (TAG). If there are too many objects in the game scene, do not use them.
The three scripts define a public GameObject variable. The gameobject is dragged to the variable in the view panel.
After obtaining the gameobject, the specific operation will not be mentioned.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.