• 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 /
avatar image
Question by Jules · Jul 12, 2010 at 01:34 AM · charactercontrollerpersonfirstvs

First Person Controller vs. Character (Penelope Tutorial)

July 13th - start of posting Good evening! Currently, I am reviewing Will Goldstone's tutorials. These tutorials are great and highly recommended. I am trying to take Will's lessons of touching the door of the house and trying to have Penelope's character open the door of the house. I have spent hours trying to get this work but to no avail. The tutorial talks about add the scripts to the First person controller. However, I have character and am not using the first person controller. Just wondering how I can create animation and interactions with a character but not link it to a First Person Controller but add it to the Penelope Tutorial character. Any assistance would be most appreciated. Take care - Julie

July 14th (removed old pics) Maybe this will clarify a bit. I want to just have the door open by taking my player character and hitting the door trigger. I can't for the life of me figure this out. Any help would be greatly appreciated.

July 15th - 9:06pm

Hopefully, I am getting closer but still can't seem to get it. I know I am missing something. This is what I have now. I added the Rigidbody and box collider to the player. I also revised scripts to the door. I am using iPhone 1.7 development and have three scenes of the Penelope Tutorial. I just want my player to click the door and open it. I can't see to figure it out. Any help is truly appreciated! Take care - Julie

http://student-iat.ubalt.edu/students/gilliam_j/help/house1.jpg http://student-iat.ubalt.edu/students/gilliam_j/help/door.jpg http://student-iat.ubalt.edu/students/gilliam_j/help/houseunderhouse1.jpg http://student-iat.ubalt.edu/students/gilliam_j/help/player1.jpg http://student-iat.ubalt.edu/students/gilliam_j/help/playerpart2.jpg http://student-iat.ubalt.edu/students/gilliam_j/help/trigger.jpg http://student-iat.ubalt.edu/students/gilliam_j/help/trigger_js.jpg

Comment

People who like this

0 Show 2
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 cncguy · Jul 12, 2010 at 10:18 AM 0
Share

Do I understand correctly that you want the door to open when Penelope makes contact with the door?

avatar image Jules · Jul 12, 2010 at 07:52 PM 0
Share

Yes, exactly. It seems the tutorial adds the action to First Person Controller but not the player.

2 Replies

  • Sort: 
avatar image

Answer by spinaljack · Jul 15, 2010 at 11:55 AM

On the door object write this:

function OnTriggerEnter(other : Collider){
   print(other.gameObject.name);
   if(other.CompareTag("Player")){
      // open door
   }
}

Comment

People who like this

0 Show 4 · 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
avatar image Jules · Jul 15, 2010 at 01:16 PM 0
Share

Thank you so much for your help! Still for some reason can't get it. I must have something set up wrong. Any insight would be most appreciative. Take care Jules http://dentaletc.umaryland.edu/gilliam/help2.unityPackage.zip

avatar image spinaljack · Jul 15, 2010 at 03:20 PM 0
Share

Did you tag your player as "Player"? Does the player have a collider? Does the player have a rigidbody? You need these 3 things to make it work

avatar image Jules · Jul 15, 2010 at 05:00 PM 0
Share

The Player is tagged as "Player". But not sure about the other two things. Would the player need to have code as well indicating the collision? Thank you so much for your help!

avatar image spinaljack · Jul 15, 2010 at 08:37 PM 0
Share

No, the door detects every rigid body with a collider that enters its trigger. If the object is tagged as player then it'll perform whatever script you've put in that if-statement. To test if it's working you can put a print(other.gameObject.name); to the script to print every object that triggers the door.

avatar image

Answer by Jules · Jul 21, 2010 at 01:10 AM

Realization - Upon trying to resolve this task and spending hours trying to find a solution sometimes we need to take a step back. In taking a step back, I realized I need to better understand the basics of programming first and features in which Unity 3d has to offer. So I started reviewing the tutorials at http://www.vtc.com for the iPhone development. This has really helped understand how scripting in should be utilized in the program. Thank you for everyone's help in trying to resolve my issue. Take care - Jules

Comment

People who like this

0 Show 0 · 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

Unity Answers is in Read-Only mode

Unity Answers content will be migrated to a new Community platform and we are aiming to launch a public beta on June 13. Please note, Unity Answers is now in read-only so we can prepare for the final data migration.

For more information and updates, please read our full announcement thread in the Unity Forum.

Follow this Question

Answers Answers and Comments

No one has followed this question yet.

Related Questions

First person controller- Random Jump 1 Answer

First Person Controller Collider 1 Answer

Speedometer for a First Person Controller 1 Answer

Help with the first person controller.(i can't find it on any folder) 2 Answers

Multiplayer First Persson Controller help 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