x


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

more ▼

asked Jul 12 '10 at 01:34 AM

Jules gravatar image

Jules
1 2 2 4

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

Jul 12 '10 at 10:18 AM cncguy

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

Jul 12 '10 at 07:52 PM Jules
(comments are locked)
10|3000 characters needed characters left

2 answers: sort voted first

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

more ▼

answered Jul 21 '10 at 01:10 AM

Jules gravatar image

Jules
1 2 2 4

(comments are locked)
10|3000 characters needed characters left

On the door object write this:

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

answered Jul 15 '10 at 11:55 AM

spinaljack gravatar image

spinaljack
9.1k 18 31 91

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

Jul 15 '10 at 01:16 PM Jules

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

Jul 15 '10 at 03:20 PM spinaljack

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!

Jul 15 '10 at 05:00 PM Jules

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.

Jul 15 '10 at 08:37 PM spinaljack
(comments are locked)
10|3000 characters needed characters left
Your answer
toggle preview:

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

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Topics:

x1047
x524
x70
x62
x10

asked: Jul 12 '10 at 01:34 AM

Seen: 2331 times

Last Updated: Jul 16 '10 at 01:07 AM