- Home /
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
Do I understand correctly that you want the door to open when Penelope makes contact with the door?
Yes, exactly. It seems the tutorial adds the action to First Person Controller but not the player.
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
}
}
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
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
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!
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.
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
Your answer
Follow this Question
Related Questions
Multiplayer Help 2 Answers
first person controller prefab 6 Answers
How To Change First Person Controller Model? 3 Answers
No standard assets 1 Answer