Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
  • Help Room /
avatar image
0
Question by Br0Quest · Jan 12, 2017 at 01:16 PM · codepage

How to make Riggged character visible with trigger?

So there is path which the player walks down, at a certain point there is an invisible plane that is a trigger. When the player collides with the trigger, the enemy character becomes visible behind him and activates a script that has the enemy follow the player.

I had this so far :

var Zombie : GameObject; var trigger = false;

  function Start   ()   {
 trigger = false;
 Zombie.GetComponent.<Renderer>().enabled = false;
 }

  function OnTriggerEnter (other : Collider) {
 trigger = true;
 }

  function Update () {
     if (trigger == true) {
         Zombie.GetComponent.<Renderer>().enabled = true;
     }
 }

I didn't realize that the character rig I was working with was just a folder containing subfolders which contained the individual pieces of the whole character e.g. head, neck, spine.... and each has its own mesh renderer. Please explain to me a way to make this possible, (and if you have the time, how to also activate the follow script on trigger)

Thanks!

Comment
Add comment · Show 1
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image ownerfate · Jan 13, 2017 at 09:28 PM 1
Share

first off, looking at the " OnTriggerEnter ( other : Collider ) " part.

you have to define other.

e.g. OnTriggerEnter (other : Collider){ if(other.tag == "Player"){ //code here; } }

if you're player has a tag, add it to the if statement

that may be the problem.

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by fahimalavi · Jan 14, 2017 at 10:52 AM

First of all if I would be you then I would make life easy, spawn a zombie prefab using Instantiate instead of making it visible using rendering tag. When you instantiate your character Start method will be called, use this method to follow the player.

Regarding your mesh hierarchy, it depends how you have made your mesh in maya or any other similar software. , it will be visible in same way. If I would be you I would import maya .mb file directly into unity3d like I did in RabbitBinkies.

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

61 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

unfortunatelt,App) has stoped working 1 Answer

If statement is always true 2 Answers

Code error :/ 1 Answer

Need help with code. Issue CS0131,Having troubles cs0131 2 Answers

code error how i fix this?,how i fix this coding error? 0 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges